I'm a newbie to solr and tying my hands at solr. Can some one here please explain how to specify multiple facet fields for a given search.
I'm using the Solr Admin UI/ query ink and it allows me to specify only one field. I would however like to facet on multiple fields like region industry stock-exchange etc on my company search.
I have gone through the solr wiki and relevant doc links like the one below http://docs.lucidworks.com/display/solr/Query+Screen
but none of them seem to explain how to specify multiple fields. I want to build something like the usual Amazon/Walmart etc search ui that provides multiple facets and counts when trying to search for a product on my planned cmpany search page.
You are looking for json.facet
It's available from solr 5(some advanced features are available from solr 6). Basically that means you can insert your facet search parameters via json to the url.
It looks like this(live example):
&facet=true&json.facet={"filed1":{"type":"terms","field":"filed1","limit":2000},"filed2":{"type":"terms","field":"filed2","limit":2000}}
There is also a shorter version:
&facet=true&json.facet={"field1":{"terms":"field1"},"field2":{"terms":"field2"}}
You can find more information here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With