带有 ES 字段映射到 `geo_shape` 的 JanusGraph
JanusGraph with ES Field Mapping to `geo_shape`
您好,我正在使用 JanusGraph 0。3.x 将 ElasticSearch 6 作为索引后端
我想将我的字段映射到 geo_shape
但它在弹性中显示为 geo_point
我正在使用 java
mgmt.buildIndex("searchI", Vertex::class.java).addKey(fullText)
.addKey(hashTagText)
.addKey(geoPoint)
.addKey(geoShape)
.buildMixedIndex("search")
我希望 geoShape
成为 geo_shape
这是弹性结果
{"janusgraph":{"mappings":{"searchI":{"properties":{"all":{"type":"text"},"full_text":{"type":"text","copy_to":["all"]},"geo_point":{"type":"geo_point"},"geo_shape":{"type":"geo_point"},"hashtag_text":{"type":"text","copy_to":["all"]}}}}}}
我们可以在source code中看到默认选择geo_point
而不是geo_shape
。
为了改变这种行为,您可以使用与默认映射不同的映射,如 the documentation:
中所述
mgmt.buildIndex("searchI", Vertex::class.java).addKey(fullText)
.addKey(hashTagText)
.addKey(geoPoint)
.addKey(geoShape, Mapping.PREFIX_TREE.asParameter()) <-- change this
.buildMixedIndex("search")
您好,我正在使用 JanusGraph 0。3.x 将 ElasticSearch 6 作为索引后端
我想将我的字段映射到 geo_shape
但它在弹性中显示为 geo_point
我正在使用 java
mgmt.buildIndex("searchI", Vertex::class.java).addKey(fullText)
.addKey(hashTagText)
.addKey(geoPoint)
.addKey(geoShape)
.buildMixedIndex("search")
我希望 geoShape
成为 geo_shape
这是弹性结果
{"janusgraph":{"mappings":{"searchI":{"properties":{"all":{"type":"text"},"full_text":{"type":"text","copy_to":["all"]},"geo_point":{"type":"geo_point"},"geo_shape":{"type":"geo_point"},"hashtag_text":{"type":"text","copy_to":["all"]}}}}}}
我们可以在source code中看到默认选择geo_point
而不是geo_shape
。
为了改变这种行为,您可以使用与默认映射不同的映射,如 the documentation:
中所述mgmt.buildIndex("searchI", Vertex::class.java).addKey(fullText)
.addKey(hashTagText)
.addKey(geoPoint)
.addKey(geoShape, Mapping.PREFIX_TREE.asParameter()) <-- change this
.buildMixedIndex("search")