为elasticsearch创建Titan索引类型

时间:2013-12-10 14:57:53

标签: indexing cassandra elasticsearch titan

我在使弹性搜索索引与Titan Server正常工作时遇到问题。我目前使用Titan Server 0.4.0进行了本地Titan / Cassandra设置,并启用了弹性搜索。我有一个带有以下属性的测试图'bg':

  • 顶点有两个属性,“type”和“value”。
  • Edges有许多其他属性,名称如“timestamp”,“length”等。

我正在使用rexster-cassandra-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()

但说实话,我不知道这是如何运作的。任何人都可以帮我指出正确的方向吗?我完全不熟悉弹性搜索和Titan类型定义。

谢谢,

亚当

1 个答案:

答案 0 :(得分:-1)

Wiki页面Indexing Backend Overview应该回答您问题的每一个细节。

干杯, 丹尼尔

相关问题