问题描述
基于问题
如果您希望将图中的树形结构作为索引,您需要使用RTree索引(这是Neo4j Spatial中的默认值)。如果您想要一个geohash索引,则图形中将不会有任何树,因为geohhes会以字符串形式存储在lucene索引中,用于字符串前缀搜索。字符串前缀搜索是搜索基于geohash的索引的常用方法。
Based on a problem here an expert have answered with this code:
CALL spatial.addPointLayerGeohash('my_geohash_layer_name')
CREATE (n:Node {latitude:60.1,longitude:15.2}) WITH n
CALL spatial.addNode('my_geohash_layer_name',n) YIELD node
RETURN node
to create a geohash tree that organise spatial nodes.
so i tried that with two spatial nodes but unlike R-tree the spatial nodes aren't linked to the layer with any connection !? is this code true ? or what is wrong ?
If you want an in-graph tree structure as an index, you need to use the RTree index (which is the default in Neo4j Spatial). If you want a geohash index, there will be no tree in the graph because geohashes are being stored as strings in a lucene index for string prefix searches. String prefix searches are a common way of searching geohash based indexes.
这篇关于如何在neo4j中创建geohash树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!