我正在尝试通过Batch填充WKT节点。
空间索引名称是'Geocode',批处理创建lucene索引'Geocode-neo4j_spatial .....'当我对'Geocode'索引执行'withinDistance'密码时,我得到'索引不存在'错误。
有人可以帮我解决下面代码中遗漏/错误的原因吗?
IndexImplementation indexImpl = new SpatialIndexImplementation(graphService);
//Creating Index. I see that the associated lucene index is getting created
Index<Node nodeIndex = indexImpl.nodeIndex("Geocode", SpatialIndexProvider.SIMPLE_WKT_CONFIG);
Label label = DynamicLabel.label("Address");
GlobalGraphOperations global = GlobalGraphOperations.at(graphService);
Iterable<Node allNodes = global.getAllNodesWithLabel(label);
for(Node node: allNodes){
if(node.hasProperty("addressLine1")){
//Adding to the Spatial Index. I see that LayerNodeIndex.add method is called
nodeIndex.add(node, "addressLine1",
node.getProperty("addressLine1"));
}
答案 0 :(得分:0)
我认为您的索引创建错误。
应该是:
gdb.index().forNodes("GeoCode",SpatialIndexProvider.SIMPLE_WKT_CONFIG);
所有impl东西应该在服务器端发生。