orientechnologies / orientdb-gremlin

TinkerPop3 Graph Structure Implementation for OrientDB
Apache License 2.0
91 stars 32 forks source link

Gremlin doesn't use Lucene indexes #162

Closed bigman73 closed 4 years ago

bigman73 commented 5 years ago

A Vertex Class property exists and an index of type FULL TEXT Lucene is using it. With ODB SQL the command works, uses the index and return results as expected:

    select firstName, lastName from people where searchData LUCENE 'orient~ -nodejs'

But with a gremlin query the Lucene index is not used for the query and no results return:

   g.V().hasLabel('people').has('searchData', 'orient~ -nodejs')

The expected behavior is that if a field (searchData in this example) has a Lucene index assigned to it then the Lucene engine would use the search value

wolf4ood commented 5 years ago

Hi @bigman73

unfortunately there is no way. has step is translated to = in SQL which does not use Lucene indexes. AFAIK TP3 does not support predicate like. http://tinkerpop.apache.org/docs/current/reference/#a-note-on-predicates It would be cool to have TP3 support something like P.like("orient~ -nodejs") that could be easily translated into a lucene query