First, terminology clarification. fq is *filter* query. facet.query is facet query.

On Nov 24, 2008, at 9:55 AM, Jae Joo wrote:
I am having some trouble to utilize the facet Query. As I know that the
facet Query has better performance that simple query (q).

The performance is (about?) the same, caches excluded. But fq's get added to the filterCache, q's to the queryCache.

Here is the example.

http://localhost:8080/test_solr/select?q=*:*&facet=true&fq=state:CA&facet.mincount=1&facet.field=city&facet.field=sector&facet.limit=-1&sort=score+desc

--> facet by sector and city for state of CA.
Any idea how to optimize this query to avoid "q=*:*"?

In this case you could use q=state:CA and remove fq=state:CA, but performance-wise as well as all other things considered, I'd stick with what you've got - just warm those filterCaches up and your performance should be quite acceptable. Report back with more details if not.

        Erik

Reply via email to