我正在尝试通过 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"));
}