I was doing some performance testing on facet queries and I noticed
something odd. Most queries tended to be under 500 ms, but every so often
the query time jumped to something like 5000 ms.

q=*:*&fq={!tag=productBrandId}productBrandId:(156
1227)&facet.field={!ex=productBrandId}productBrandId&facet=true

I noticed that the drop in performance happened any time I had a filter
query tag match up with a facet exclusion. If I had a query where the tags
and exclusions differ, like the following...

q=*:*&fq={!tag=foo}foo:123&facet.field={!ex=bar}bar&facet=true

... then performance was fine. Any time a "tag" and "ex" parameter matched,
I would see the drop in performance.

I worked around this by constructing individual queries for each facet I
wanted to construct and not using the filter query exclusion feature at
all. Running the multiple separate facet queries ended up being much faster
than using the filter query exclusion feature.

I wasn't able to find anything on the bug tracker about this. Does anyone
have any hints about what could be causing this? I'm on Solr 4.4 and have
not tested newer versions, so I don't know if this problem has been
addressed.

- Hayden

Reply via email to