SOLR filter query for basic query

SOLR docs , specify that filter queries , as opposed to the main query , do not affect the evaluation of the document. Can someone explain what this means exactly, preferably with an example.

Thank.

+46
filter solr
Jan 04 2018-12-12T00:
source share
2 answers

Filter_Query ONLY stores the IDS of the document. This makes the filter very quick to include / exclude documents. Good examples of this are filtering products from a search based on country, product type, availability, etc.

A regular query can perform the same function, but it has a very sophisticated scoring system to determine "relevance." I believe that the documentation indicates that scoring is done only in the main request, and not in the filter. This should also increase the speed of the request.

So, I can request for:

description:Kohler AND productType:Toilet 

Or I can request for:

 description:Kohler with a FQ of productType:Toilet 

The results will be the same, but the ratings will be different. In addition, if you receive many different requests during the day, which for productType:Toilet , FilterQuery will be cached, which will speed up the overall request time.

+48
Jan 04 '12 at 17:20
source share

fq is for a fixed list of values. If you search on q = sunroof + stereo and fq = Mustang solr will perform a text analysis on the q parameter, since q = sunroof + stereo and q = stereo + sunroof will return the same set of results. But when filtering a search by fq, there is no analysis applied to the fq parameter, and he suggested that all returned documents will match fq, so there is no need for him to change the rating of the corresponding documents.

+3
Jan 04 '12 at 18:05
source share



All Articles