簡體   English   中英

Solr位置構面搜索

[英]Solr location facet search

我正在使用solr進行多面搜索。 我在Solr中填充了數據,一個典型的文檔如下所示:

<doc>
<str name="id">1</str>
<date name="last_modified">2012-06-03T07:23:11.215Z</date>
<str name="location">22.60325666,114.1371245</str>
<int name="media_type">0</int>
</doc>

當我運行查詢時:{!geofilt pt = 37.3320927,-121.90056663 d = 100 sfield = location d = 5}我得到了2個文檔。 同樣,當我運行:{!geofilt pt = 37.3320927,-121.90056663 d = 100 sfield = location d = 50}時,我得到了6個文檔。

但是當我運行查詢時:

http://localhost:8983/solr/select?sfield=location&pt=37.3320927,-121.90056663&facet.query={!geofilt%20d=10%20key=d10}&facet.query={!geofilt%20d=20%20key=d20}&facet.query={!geofilt%20d=50%20key=d50}&wt=xml&facet=true

我得到回應:

同樣適用於:

http://localhost:8983/solr/select?sfield=location&pt=37.3320927,-121.90056663&facet.query={!geofilt%20d=10%20key=d10}&facet.query={!geofilt%20d=20%20key=d20}&facet.query={!geofilt%20d=50%20key=d50}&wt=xml&facet=true

我得到回應:

我做錯了什么嗎?

通過使用查詢,我可以正常工作:

http://localhost:8983/solr/select?q=*:*&sfield=location&pt=37.3320927,-121.90056663&facet.query={!frange l=0 u=5}geodist()&facet.query={!frange l=5.001 u=20.0}geodist()& &facet.query={!frange l=20.001 u=100}geodist()&facet.pivot=media_type&wt=xml&facet=true&rows=0

下一個問題是如何為查詢添加另一個方面? 具體來說,在這種情況下,我想使用media_type分解結果。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM