OrientDB Gremlin - g.getVertices to do a fulltext search/match on a property

263 views Asked by At

I'm trying to find out how can I do a LIKE query in gremlin using the getVertices or similar method, which would hit the indexes. I'm using OrientDB 2.1.11 and Gremlin.

This works, but does an exact match:
g.getVertices('city_state.city','VANCOUVER')

What I need to do is something like below (doesn't work though):
g.getVertices('city_state.city','VANC%')

Would be awesome if I can use the LUCENE index, if its supported.

1

There are 1 answers

1
LucaS On

You could try this query:

g.V.has('@class','city_state').filter{it.city.matches('VA‌​N.*')}

or this (similar to yours):

g.V.has('@class','city_state').filter{it.getProperty('city').matches('VA‌​N.*')}