gpt4 book ai didi

elasticsearch - 带有边界框GeoLocation的 Elasticsearch 渗透在Lucene中引发NullPointerException

转载 作者:行者123 更新时间:2023-12-02 22:39:50 26 4
gpt4 key购买 nike

从Elastic Search 2.1.0迁移到2.2.0时遇到的有趣问题。

当前,我们正在使用ES的渗滤功能,部分查询涉及边界框查询。

索引映射代码段:

{
"mappings": {
"person": {
"properties": {
...
"location": {
"type": "geo_point"
},
...
}
}
}

然后说,我们有一个查询,该查询使用地理边界框进行过滤:
... query... 
{
"geo_bounding_box": {
"location": {
"top_left": [151.197033, -33.85610899999999],
"bottom_right": [151.22295099999994, -33.879704]
}
}
}

调用percolation API后,它将返回以下响应:
{
"took": 18,
"_shards": {
"total": 5,
"successful": 4,
"failed": 1,
"failures": [
{
"shard": 1,
"index": "indexname_20160217",
"status": "INTERNAL_SERVER_ERROR",
"reason": {
"type": "null_pointer_exception",
"reason": null
}
}
]
},
"total": 0,
"matches": []
}

到具有位置的文档:
"location": {
"lat": -33.86747690000000,
"lon": 151.20697759999996
}

但是 并非一直存在,例如如果我将坐标更改为其他值,它将返回结果。有些坐标会抛出它,有些则不会。有什么想法吗?

flex 搜索服务器堆栈跟踪是这样的:
Caused by: java.lang.NullPointerException
at org.apache.lucene.search.GeoPointTermQueryConstantScoreWrapper$1.getDocIDs(GeoPointTermQueryConstantScoreWrapper.java:86)
at org.apache.lucene.search.GeoPointTermQueryConstantScoreWrapper$1.scorer(GeoPointTermQueryConstantScoreWrapper.java:126)
at org.apache.lucene.search.BooleanWeight.scorer(BooleanWeight.java:280)
at org.apache.lucene.search.BooleanWeight.scorer(BooleanWeight.java:280)
at org.apache.lucene.search.BooleanWeight.scorer(BooleanWeight.java:280)
at org.elasticsearch.common.lucene.Lucene.exists(Lucene.java:248)
at org.elasticsearch.percolator.QueryCollector$Match.collect(QueryCollector.java:184)
at org.apache.lucene.search.Weight$DefaultBulkScorer.scoreAll(Weight.java:218)
at org.apache.lucene.search.Weight$DefaultBulkScorer.score(Weight.java:169)
at org.apache.lucene.search.BulkScorer.score(BulkScorer.java:39)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:821)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:535)
at org.elasticsearch.percolator.PercolatorService.queryBasedPercolating(PercolatorService.java:816)
at org.elasticsearch.percolator.PercolatorService.access$400(PercolatorService.java:108)
at org.elasticsearch.percolator.PercolatorService$5.doPercolate(PercolatorService.java:609)
... 10 more

为什么某些latlong会发生这种情况的任何想法都很好。谢谢!

最佳答案

我遇到了类似的问题,并且由于在geo方面所做的所有工作,我相信这是Elasticsearch 2.2.0中的错误,详细信息请参见Supercharging geo_point fields in Elasticsearch 2.2

我已经在Github上提交了错误报告,并提供了指向您在Github Issue #16832上发布的内容的链接以及我自己的问题示例。

关于elasticsearch - 带有边界框GeoLocation的 Elasticsearch 渗透在Lucene中引发NullPointerException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35451052/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com