关于solr中的距离的方面-如何生成在给定距离范围内搜索的链接 [英] Faceting on distance in solr- how to generate links that search withing a given range of distance
问题描述
在Solr中为距离的范围或桶"生成构面非常简单: http: //wiki.apache.org/solr/SpatialSearch#How_to_facet_by_distance
It is fairly simple to generate facets for ranges or 'buckets' of distance in Solr: http://wiki.apache.org/solr/SpatialSearch#How_to_facet_by_distance
这里没有描述的是如何为这些方面生成链接
What isnt described is how to generate the links for these facets
如果这是返回5公里之内的所有内容的查询:
If this is the query to return everything within 5km :
& q = :& fq = {!geofilt sfield = store}& pt = 45.15,-93.85& d = 5
&q=:&fq={!geofilt sfield=store}&pt=45.15,-93.85&d=5
-那么搜索5至10公里之间的所有内容的语法将是什么?
-what then would be the syntax to search for everything between 5 and 10km ?
基本上我可以生成距离刻面,但是我不知道如何为距离刻面生成链接:
Basically I can generate distance facets, but I dont know how to generate the links for the distance facets:
例如,以下方面的链接是什么样的?
for example, what would the links for the following facets look like?:
距离
0-1公里(2)
1-5公里(0)
5-20公里(0)
20-50公里(0)
20-50km (0)
50-100公里(0)
50-100km (0)
100-250公里(0)
100-250km (0)
推荐答案
Wiki确实对此进行了描述:
The wiki does describe it:
&q=*:*&sfield=store&pt=45.15,-93.85&facet.query={!frange l=0 u=5}geodist()&facet.query={!frange l=5.001 u=3000}geodist()
这将生成一个从0到5km的构面,另一个从5km到3000km.根据需要更改frange中的值.
This will generate a facet from 0 to 5km and another from 5km to 3000km. Change the values in frange according to your needs.
如果您要对 filtering 使用一定范围的距离,则应将构面查询移至过滤器查询,例如fq={!frange l=5.001 u=3000}geodist()
If you meant filtering with a range of distances, moving the facet query to a filter query should work, e.g. fq={!frange l=5.001 u=3000}geodist()
这篇关于关于solr中的距离的方面-如何生成在给定距离范围内搜索的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!