Lucene在6.0中添加multi dimensional point support
https://issues.apache.org/jira/browse/LUCENE-7494
我怎样才能在Solr中使用它?我希望有一个简单的端到端示例"这将是一篇有价值的博客文章。
1)在架构中定义
curl -XPOST -H 'Content-type:application/json' --data-binary '{
"add-field-type" : {
"name":"mypoint",
"class":"solr.DoublePointField" //is this right?
}}' http://localhost:8983/solr/mycore/schema
curl -XPOST -H 'Content-type:application/json' --data-binary '{
"add-field":{
"name":"coords",
"type":"mypoint",
"stored":true,
"indexed":true
}
}' http://localhost:8983/solr/mycore/schema
2)发布数据
curl -X POST -H 'Content-Type: application/json' --data-binary '{
"id": "1",
"coords": "1.5 -0.2222 14213 here I can use my n-dimensional point?",
}' http://localhost:8983/solr/mycore/update/json/docs
3)进行点距离或距离查询
??? I don't know how to do this.
更新:我最终使用了postgresql,它通过cube插件支持k-d树欧氏距离搜索。