Question

Say I want to fetch all users who belong to org number 2 and the have the string "baba" in them. I can do either:

q=baba AND org:2 

OR

q=baba&fq=org:2

I am not sure what is the difference. Can some one shade some light.

Was it helpful?

Solution

A filter has no effect on scoring, it just does the filtering part. Filters are also more performant in situations where a) the number of matching docs is high and 2) the results are often reused.

OTHER TIPS

filtering also allows tagging of facets.
you can tag facets to include all facets that are returned for your query, not taking into account the FQ.
For exmaple in you post if you returned org as facets and there were 10 with value 1 and 10 with value 2, the "q=baba AND org:2" would return facets with q 2(10), but if you did q=baba&fq=org:2 and tagged the facet you would get facets with q 1(10) 2(10).

Hope that makes sense

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top