Several faces in the field with Solr

By default, Solr returns the faces for the field, and then if you select the face value for this field, all other previous options no longer return as part of the facets for this field.

I am trying to develop a search engine that looks more like an Amazon search engine (which is based on A9's own search engine and therefore looks like Amazon CloudSearch).

When you narrow down to certain β€œfaces” in your Amazon searches, they continue to show other options along with the counts if you want to add this area to your search.

Is there a built-in way to do this in Solr? If not, how would I roll back. Obviously, I will need to cache the original faces returned for the field. But what would be the most efficient way of counting counts for other boundary areas as soon as I have already selected one (or more) faces for the field. Obviously, when you select additional faces, you run an "OR" query between these values, since you are trying to show things with either of the two values.

For example, I searched the Amazon jewelry department for a diamond ring, and then narrowed it to Gold as a metal type. Then I was able to select several carat faces:

Example Amazon faceting

Can anyone provide an example of how I could (efficiently) do this with Solr?

And is there any feature in the work for a future version of Solr that would offer this functionality out of the box (if it was not already in the box)?

+4
source share
2 answers

Tagging and excluding Filters Functionality in Solr may be the function you are looking for, here is a Wiki link explaining Multi Select Faceting .

Example:: ../ solr / select /? Q = * & rows = 0 & facet = on & fq = {! Tag = krt} KARAT: 10k_Gold & facet.field = {! ex = crit} CARAT

This feature is present since Solr 1.4, I think.

+7
source

Multi-screen faceting using the new JSON Facet API Solr API works differently. You still mark the filters the same way, but there is a different exception syntax.

 &q="running shorts" &fq={!tag=COLOR}color:(Blue Black) &json.facet={ sizes:{type:terms, field:size}, colors:{type:terms, field:color, domain:{excludeTags:COLOR} }, brands:{type:terms, field:brand, domain:{excludeTags:BRAND} } } 

Note the = COLOR tag for the filter that selects for Blue or Black elements. When we border on color, we want to ignore (or exclude) filters with this tag so that we still get other colors. What the domain does: {excludeTags: COLOR}.

This example was taken from http://yonik.com/multi-select-faceting/

+3
source

Source: https://habr.com/ru/post/1440120/


All Articles