我们最近从 Neo4j 1.9 升级到 2.1,现在在使用空间索引更新现有对象时收到错误消息。
我们正在使用以下内容:
Spring Data NEO4J 3.1 Neo4j 2.1.2 服务器与空间插件
我已将问题缩小到以下 REST 调用:
http://localhost:7474/db/data/index/node/<index name>
JSON Post:
{
"value" : "POINT(-87.626451 41.870515)",
"uri" : "http://localhost:7474/db/data/node/113",
"key" : "wkt"
}
我收到以下回复:
{
"message" : "GeometryNode not indexed in this RTree: 114",
"exception" : "RuntimeException",
"fullname" : "java.lang.RuntimeException",
"stacktrace" : [ "org.neo4j.gis.spatial.rtree.RTreeIndex.findLeafContainingGeometryNode(RTreeIndex.java:812)", "org.neo4j.gis.spatial.rtree.RTreeIndex.remove(RTreeIndex.java:111)", "org.neo4j.gis.spatial.rtree.RTreeIndex.remove(RTreeIndex.java:100)", "org.neo4j.gis.spatial.EditableLayerImpl.update(EditableLayerImpl.java:56)", "org.neo4j.gis.spatial.indexprovider.LayerNodeIndex.add(LayerNodeIndex.java:143)", "org.neo4j.gis.spatial.indexprovider.LayerNodeIndex.add(LayerNodeIndex.java:41)", "org.neo4j.server.rest.web.DatabaseActions.addToNodeIndex(DatabaseActions.java:686)", "org.neo4j.server.rest.web.RestfulGraphDatabase.addToNodeIndex(RestfulGraphDatabase.java:1022)", "java.lang.reflect.Method.invoke(Unknown Source)", "org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139)", "java.lang.Thread.run(Unknown Source)" ]
}
编辑
在做了一些额外的研究后,我发现错误被抛出,因为几何关系的根节点(952)不等于索引根的根节点(2308)。
以下是关联几何节点和索引根的关系和节点属性:
114<-[RTREE_REFERENCE]-6<-[RTREE_CHILD]-952<-[RTREE_CHILD]-(null)
114
id 113
bbox [-87.626451,41.870515,-87.626451,41.870515]
wkt POINT (-87.626451 41.870515)
gtype 1
6
bbox [-88.459688,41.711991,-86.856991,42.153793]
952
bbox [-118.823745,0,0,44.591593]
2307-[RTREE_ROOT]->[2308]
2307
layer_class org.neo4j.gis.spatial.EditableLayerImpl
layer dib_location
geomencoder org.neo4j.gis.spatial.WKTGeometryEncoder
geomencoder_config wkt
ctime 1404877913340
2308
layer_class org.neo4j.gis.spatial.EditableLayerImpl
layer dib_location
geomencoder org.neo4j.gis.spatial.WKTGeometryEncoder
geomencoder_config wkt
ctime 1404877913340