0

I tried to use spatial, found the official guide use legacy index in the doc, and the cypher query is not working. http://neo4j-contrib.github.io/spatial/#rest-api-create-a-spatial-index

How can I use latest index method '/schema/index', instead of '/index/node'? And is there a good way to support query filter by other properties? Thanks.

navins
  • 3,429
  • 2
  • 28
  • 29

2 Answers2

0

cosider this hack method: Update to: Adding node to Neo4j Spatial Index

the hack is :

POST /db/data/transaction/commit HTTP/1.1
Host: localhost:7474
Accept: application/json
Content-Type: application/json
Cache-Control: no-cache

{ 
    "statements" : [ 
        { "statement" : "match (n:City) set n.id=id(n)" } 
    ] 
}

then do the cypher query.

Community
  • 1
  • 1
navins
  • 3,429
  • 2
  • 28
  • 29
0

No, you can't use a schema index for spatial (yet).

You have to configure the spatial index either as manual or auto-index and add your nodes to it. Then the spatial cypher query works.

Michael Hunger
  • 41,339
  • 3
  • 57
  • 80
  • Can auto-index be set to be spatial index in the neo4j.properties file? it seems there's bug in the plugin. I should set the id before I can use cypher query. – navins May 29 '15 at 12:25