Solr: Apply faceting when query contains particular terms

29 views Asked by At

I have a database of product information indexed by name, type, manufacturer, etc. Users often submit search queries whose results would be contained neatly in one or more facets. When this situation arises, I would like for Solr to parse the query and apply the relevant facets.

For example, searching shoes should return results in the shoe category. More ambitiously, searching plaid shirt should query plaid on items in the shirt category.

Is it possible to configure Solr to do this?

Thanks in advance.

1

There are 1 answers

0
nick_v1 On

Asking Solr to do what you want is a tall order. Your best bet would be to store categories in a field that is weighted very highly. For example, if you have a category field with the value of "shoes", having a hit on that field will increase the relevance of documents on that category, thus having them show up first. Same goes for the second example.

As for faceting, your question is not clear on how you want to apply faceting.