0

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

1 回答 1

0

我认为您的索引创建是错误的。

它应该只是:

gdb.index().forNodes("GeoCode",SpatialIndexProvider.SIMPLE_WKT_CONFIG);

所有 impl 的东西都应该发生在服务器端。

于 2014-02-16T14:24:36.600 回答