2016-02-26 82 views
0

我想知道如何在gremlin中使用getVertices或类似的方法来执行LIKE查询,这会碰到索引。我使用OrientDB 2.1.11和Gremlin。OrientDB Gremlin - g.getVertices在属性上执行全文搜索/匹配

这工作,但不会完全匹配:
g.getVertices('city_state.city','VANCOUVER')

我需要做的是类似以下(不工作,虽然):如果我能
g.getVertices('city_state.city','VANC%')

将是真棒如果支持,使用LUCENE索引。

+0

是正确的:-----> g.getVerticesOfClass( 'city_state') (''city')。matches('VAN。*')} –

回答

0

你可以试试这个查询:

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

或本(类似于你):

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

^一致返回7+秒,而 - > g.getVerticesOfClass('city_state')._()。 filter {it.city.matches('VAN。*')}在0.43秒内返回。 V = 1,170,585条记录,而city_state类有15,965条记录。我不认为它的命中(我有一个字典索引和在城市领域创建的全文索引)。 –