【问题标题】:OrientDB Gremlin - g.getVertices to do a fulltext search/match on a propertyOrientDB Gremlin - g.getVertices 对属性进行全文搜索/匹配
【发布时间】:2016-02-26 07:21:46
【问题描述】:

我正在尝试找出如何使用 getVertices 或类似方法在 gremlin 中执行 LIKE 查询,这会命中索引。我正在使用 OrientDB 2.1.11 和 Gremlin。

这可行,但完全匹配:
g.getVertices('city_state.city','VANCOUVER')

我需要做的是下面的事情(虽然不起作用):
g.getVertices('city_state.city','VANC%')

如果我可以使用 LUCENE 索引(如果它受支持),那就太棒了。

【问题讨论】:

  • 是否正确:-----> g.getVerticesOfClass('city_state')._().filter{it.getProperty('city').matches('VAN.*') }

标签: full-text-search orientdb gremlin orientdb-2.1


【解决方案1】:

你可以试试这个查询:

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.*')}

【讨论】:

  • ^ 持续 7 秒以上返回,而 -> g.getVerticesOfClass('city_state')._().filter{it.city.matches('VAN.*')} 返回 0.43秒。 V 的计数 = 1,170,585 条记录,而 city_state 类有 15,965 条记录。我不认为它的命中索引(我在 city 字段上创建了一个字典索引和一个全文索引)。
猜你喜欢
  • 2016-08-04
  • 1970-01-01
  • 2015-12-02
  • 2018-06-19
  • 2019-10-20
  • 2020-02-06
  • 2019-09-22
  • 2012-04-01
  • 1970-01-01
相关资源
最近更新 更多