views:

31

answers:

2

It is my understanding that documents are found based on a query, and then that result is then filtered by the filter.

The Query is the only that that will effect the score/relevance of a document.

Would there be any performance (caching) improvements if I query results that have relevance towards relevancy, and filter items that don't?

Here is my situation. I have a lot of products, and the website will often search for products by category or manufacturer. I was thinking about using queries for that as that will bring the products down to a smaller subset which can be cached. I can then filter my results by product specifications. Should I use filters for specifications? That way we can filter based on an already cached (by lucene) subset of products (category or manufacturer).

A: 

The difference between filter and query is mostly that filter is exact. If you filter on brand=... than you will only get that exact brand. If you query on it, you will get the brand and possibly other results that also match your query.

So the question is, do you want an exact filter, or is it just for relevance?

WoLpH
Wouldn't BoolClause.Occur.MUST make it exact? What do you mean by exact? You mean anything that products a relevance score of either 1 or 0?
Paul Knopf
@Paul Knopf: yes, in that case only the ranking should differ.
WoLpH