无法对 Solr 地理空间搜索结果进行排序

Nyx*_*yxx 5 lucene gis solr geospatial solarium

我们怎样才能拥有的Solr 3.6.1回报地理空间搜索结果被过滤bbox和排序的距离是多少?

我尝试将 a 添加&sort=geodist() ascSolr 文档中所述的 URL ,但出现错误:

sort param could not be parsed as a query, and is not a field that exists in the index: geodist()

使用排序和 bbox 查询 URL(不工作)

http://localhost8080/solr/select?wt=json&indent=true
&q=*:*
&fl=id,latlng
&fq={!bbox%20pt=42.352455,-71.048069%20sfield=latlng%20d=5}
&sort=geodist() asc
Run Code Online (Sandbox Code Playgroud)

带有排序的查询 URL (Works)

http://localhost:8080/solr/select?wt=json&indent=true
&fl=id,latlng
&q=*:*
&sfield=latlng
&pt=42.352455,-71.048069
&sort=geodist()%20asc
Run Code Online (Sandbox Code Playgroud)

使用 bbox 查询 URL (Works)

http://localhost8080/solr/select?wt=json&indent=true
&q=*:*
&fl=id,latlng
&fq={!bbox%20pt=42.352455,-71.048069%20sfield=latlng%20d=5}
Run Code Online (Sandbox Code Playgroud)

如何bbox按距离 ( geodist())对结果进行过滤和排序?

Dav*_*ley 5

只需将您拥有的 'pt' 和 'sfield' 本地参数提取到顶级查询参数中,就像您对工作排序查询所做的一样。你的 fq 将只是 {!bbox d=5}