我在使用弹性搜索索引与Titan服务器正常工作时遇到问题。我目前有一个使用Titan Server 0.4.0进行弹性搜索的本地Titan/Cassandra设置。我有一个具有以下属性的测试图'bg':为elasticsearch创建Titan索引类型
- 顶点有两个属性“type”和“value”。
- 边缘有许多其他属性,如“时间戳”,“长度”等名称。
我正在与rexster-卡桑德拉 - es.xml配置titan.sh,我的配置是这样的:
storage.backend = "cassandra"
storage.hostname = "127.0.0.1"
storage.index.search.backend = "elasticsearch"
storage.index.search.directory = "db/es"
storage.index.search.client-only= "false"
storage.index.search.local-mode = "true"
这种配置在Rexter和BG的配置相同加载数据的groovy脚本。
当我加载Rexster客户端并输入g = rexster.getGraph("bg")
时,我可以使用g.V.has("type","ip_address")
执行精确搜索并返回正确的顶点。然而,当我运行查询:
g.V.has("type",CONTAINS,"ip_")
我得到的错误:
Data type of key is not compatible with condition
我觉得这是值得做的类型“价值”没有被编入索引。我想要做的是使所有顶点和边的属性都可以索引,这样我就可以根据需要使用它们上的任何字符串匹配函数。我已经尝试使用命令制作索引键
g.makeKey("type").dataType(String.class).indexed(Vertex.class).indexed("search",Vertex.class).make()
但说实话我不知道它是如何工作的。任何人都可以帮助我指出正确的方向吗?我完全不熟悉弹性搜索和泰坦类型定义。
感谢,
亚当