gpt4 book ai didi

elasticsearch - 带有 Elasticsearch 索引的 JanusGraph 不工作

转载 作者:行者123 更新时间:2023-11-29 02:55:26 31 4
gpt4 key购买 nike

我在 JanusGraph 中添加了混合索引以支持使用 Elasticsearch 进行全文搜索。

我有混合索引,如:

myindex = mgmt.buildIndex("myesindex", Vertex.class)
.addKey("name", Mapping.TEXTSTRING.asParameter())
.addKey("sabindex", Mapping.TEXTSTRING.asParameter())
.buildMixedIndex("search");

我能够将数据加载到 Elasticsearch 引擎中。我也能够成功执行查询。

我遇到的问题是当我点击查询时:

g.V().has('code','abc').valueMap()
==>{str=[some text], code=[abc], sab=[sab], sabindex=[sabindex], name=[[some tex]]}

我成功获得了结果,但是当我尝试使用名称和代码进行搜索时:

g.V().has('name', textContains('some text')).has('code','abc').valueMap()

代码字段也被索引(复合)

当时我没有得到任何结果。尽管数据存在于图形和 Elasticsearch 中。

另一种情况是使用不同名称和代码的相同查询成功运行。我也多次重建图表,但没有得到积极的结果。

最佳答案

第一个查询显示值是 name=[[some tex]]。它在 text 中缺少最后的 t,因此这解释了为什么查询在 some text 上不匹配。

如果您改为执行 textContains('some tex'),您将获得与第一个查询相同的结果。使用 profile() 步骤将显示使用了 myindex

查看此 gist的重建场景。

关于elasticsearch - 带有 Elasticsearch 索引的 JanusGraph 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52856466/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com