I am trying to populate WKT nodes through Batch.
The spatial index name is 'Geocode' and the batch creates the lucene index 'Geocode-neo4j_spatial.....' When I execute the 'withinDistance' cypher against the 'Geocode' index, I get 'Index does not exist' error.
Could someone help me what is missing/wrong in my code below?
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"));
}