elasticsearch - 无法在 Titan 中添加混合索引

标签 elasticsearch cassandra titan

我想在 titan 中创建混合索引,所以我使用了这些 gremlin 命令

graph.tx().rollback()
mgmt.buildIndex('deviceIndex',Vertex.class).addKey(serialNumber,Mapping.STRING.asParameter()).addKey(manufacturer,Mapping.STRING.asParameter()).addKey(clas,Mapping.STRING.asParameter()).addKey(description,Mapping.TEXT.asParameter()).addKey(fw_version,Mapping.STRING.asParameter()).addKey(hw_version,Mapping.STRING.asParameter()).addKey(latitude).addKey(longitude).addKey(accuracy).addKey(measure_datetime).buildMixedIndex("search")
mgmt.commit()
mgmt.awaitGraphIndexStatus(graph, 'deviceIndex').call()

我得到的输出是:

GraphIndexStatusReport[success=false, indexName='deviceIndex', targetStatus=REGISTERED, notConverged={device_longitude=ENABLED, device_latitude=ENABLED, device_description=ENABLED, device_class=ENABLED, device_serial_number=ENABLED, device_fw_version=ENABLED, device_accuracy=ENABLED, device_hw_version=ENABLED, device_manufacturer=ENABLED, measure_datetime=ENABLED}, converged={}, elapsed=PT1M0.234S]

你能告诉我为什么输出中有一个success=false吗?为什么查询失败?

=>编辑

我使用了g.V().has('device_latitude', (float)343.2435).toList(),它没有给我任何关于整个图表正在被遍历的警告。但我无法从elasticsearch ie 进行搜索

GET http://localhost:9200/_search?pretty

结果

{
  "took" : 2,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  },
  "hits" : {
    "total" : 0,
    "max_score" : null,
    "hits" : [ ]
  }
}

最佳答案

从结果来看,“deviceIndex”似乎已注册但尚未启用。您可以尝试看看下面的代码能否解决您的问题?

graph.tx().rollback()
mgmt.buildIndex('deviceIndex',Vertex.class).addKey(serialNumber,Mapping.STRING.asParameter()).addKey(manufacturer,Mapping.STRING.asParameter()).addKey(clas,Mapping.STRING.asParameter()).addKey(description,Mapping.TEXT.asParameter()).addKey(fw_version,Mapping.STRING.asParameter()).addKey(hw_version,Mapping.STRING.asParameter()).addKey(latitude).addKey(longitude).addKey(accuracy).addKey(measure_datetime).buildMixedIndex("search")
mgmt.commit()
graph.tx().commit()
ManagementSystem.awaitGraphIndexStatus(graph, 'deviceIndex').status(SchemaStatus.ENABLED).call()
有时,特别是在远程数据存储中(通过高延迟网络),索引需要一些时间才能立即启用,等待索引启用可能会对您的情况有所帮助。

关于elasticsearch - 无法在 Titan 中添加混合索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37895135/

相关文章:

nosql - 在Cassandra中调整写入性能

nosql - Cassandra (CQL3) 是否可以插入语句二进制数据?

java - 使用 Titan 或 TinkPop Java api 查找顶点/节点

graph-databases - 如何使用蓝图从 Titan 迁移出去?

join - 如何在 Elasticsearch 中进行连接——或在 Lucene 级别

java - 在java中构建kibana查询以从elasticsearch中获取记录

elasticsearch - 使用Elastic Search Nest插入数据的性能问题

java - Titan Factory.open() 配置

java - 尝试使用 Java MapReduce 作业批量加载到 titan 时发生 ClassNotFoundException

elasticsearch - 通过查询其他文档对对象进行Elasticsearch聚合