1
votes

We need to implement drill down search like Amazon.

enter image description here

If any supplier is selected then, currently it disabled rest of suppliers as solr facet only returns that selected filter. query: supplier:supplierId

Though above query retuns multiple Screen Color/Screen Size, but on further selection, only the selected element is returned per filter section.

Any help to make it work like Amazon.com 's refined filtering will be much appreciated.

1
you mean you want to be able to select several facet filters? - Mysterion

1 Answers

4
votes

To provide multi-select faceting, you need to tag the filter involved so that you can exclude it when faceting on the corresponding field. This can be achieved using both the tag and ex local parameters.

Solr Ref Guide - Tagging and Excluding Filters :

To implement a multi-select facet for a given field, a GUI may want to still display the other field values and their associated counts, as if the corresponding filter constraint had not yet been applied.

To return counts for the field values that are currently not selected, tag filters that directly constrain the field, and exclude those filters when faceting on it.

For example, for a query that would originally look like :

q=mainquery&fq=supplier:supplierId&facet=true&facet.field=supplier

You would do the following :

q=mainquery&fq={!tag=sup}supplier:supplierId&facet=true&facet.field={!ex=sup}supplier