简体   繁体   English

Solr地理空间搜索返回错误的距离

[英]Solr Geospatial Search return wrong distances

I'm using the Solr 3.6.1 Webapp with the SOLR-2155 Patch for geohash field support. 我正在使用Solr 3.6.1 Webapp和SOLR-2155 Patch来支持geohash。 I set everything up like described here: https://github.com/dsmiley/SOLR-2155 我设置了所有内容,如下所述: https//github.com/dsmiley/SOLR-2155

Now and then the search returns a totally false distance for every hit. 偶尔搜索会为每次点击返回一个完全错误的距离。 Refreshing the result won't help. 刷新结果无济于事。 If I change the offset of the search (eg listing the 2nd page) it's all fine again. 如果我改变了搜索的偏移量(例如列出第二页),那么一切都会好起来的。 Even going back to the first page now shows up the right distance. 即使回到第一页,现在也显示出正确的距离。

It's not the webapp because the json stream I get directly from Solr contains the same distances as result score. 它不是webapp,因为我直接从Solr获得的json流包含与结果得分相同的距离。 In my case it's always 20015,12km. 在我的情况下,它总是20015,12km。

Here is my Query: 这是我的查询:

fq={!geofilt}
&fl=internalid,score
&start=0
&rows=10
&sort=geodist()+asc
&sfield=location
&pt=53.6,10.11
&d=50
&q={!func}geodist()

I wrote SOLR-2155. 我写了SOLR-2155。 I'm not particularly happy with the distance sorting code therein; 我对其中的距离分类代码并不特别满意; there seems to be something I overlooked. 似乎有些东西我忽略了。 It shouldn't be some sort of math issue, it's some sort of Lucene internals issue, I think. 它应该不是某种数学问题,我认为这是某种Lucene内部问题。 If you have just one point per document, then use solr.LatLonType. 如果每个文档只有一个点,则使用solr.LatLonType。 If you have multiple then.... :-( I don't know what the problem is. In Solr 4, the replacement code for this called SpatialRecursivePrefixTreeFieldType and it uses different code but it is similar, so I'm not sure if the problem will go away or not. But even in that case, again, I'm not at all happy with the implementation. I know how I want to do it right, but it's not on the top of my TODO list right now. 如果你有多个那么.... :-(我不知道问题是什么。在Solr 4中,这个名为SpatialRecursivePrefixTreeFieldType的替换代码,它使用不同的代码,但它是相似的,所以我不确定是否问题会消失或不消失。但即使在这种情况下,我也不会对实施感到满意。我知道我想要做得对,但它现在不在我的TODO列表的顶部。

BTW, you are basically reporting a bug, and the proper place to report a bug would be the issue tracker of the project in question -- in this case, that's GitHub SOLR-2155. 顺便说一下,你基本上是在报告一个错误,报告错误的适当位置将是问题项目的问题跟踪器 - 在这种情况下,就是GitHub SOLR-2155。 StackOverflow doesn't make sense for that. StackOverflow对此没有意义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM