Solr Facetting - Showing First 10 results and Other

让人想犯罪 __ 提交于 2019-12-13 12:05:31

问题


I am implementing a solution in Solr where I have a lot of values in my facet.

As opposed to displaying a long list of values(facets) down the side of my page I want to display the top 10. And also have one for other.

For instance I would be faceting on Nationality.

So, I do not want to have a list of every nationality, Nor do I want a "see all" button.

What I require is the top 10 nationalitys and then "Other".

When a user clicks on other, it facets on this?


回答1:


This is quite easy in Solr.. All you need to do is add a

&facet.limit=10

e.g.

http://solrserver:8080/solr/select&version=2.2&q=solr&start=0&rows=0&indent=on&facet=on&facet.field= nationality&facet.limit=10

to your request and you should be able to limit the results.

For more information you can check out my blog post on faceting in solr:

http://www.craftyfella.com/2010/01/faceting-and-multifaceting-syntax-in.html

or the solr wiki here:

http://wiki.apache.org/solr/SimpleFacetParameters#facet.limit



来源:https://stackoverflow.com/questions/1808515/solr-facetting-showing-first-10-results-and-other

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!