最近、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