On 12/1/2011 8:01 AM, Antoine LE FLOC'H wrote:
Is there any difference in the way things are stored in the filterCache if
I do

&(fq=field1:val1 AND field2:val2)
or
&fq=field1:val&fq=field2:val2

eventhough these are logically identical ? What get stored exactly ? Also
can you point me to where in the Solr source code this processing happens ?

Your first example would result in one entry in filterCache, probably for "+field1:val1 +field2:val2" which is what the parser ultimately reduces the query to. Your second example will result in two separate entries in filterCache.

The second example takes more cache space, but it is also more reusable. If you started with a clean cache and sent "&fq=field2:val2&field3:val3" immediately after sending your second example, one of the filter queries would be satisfied from the cache, so Solr would use fewer resources on the query as a whole. If you sent your first example and then "&fq=(field2:val2 AND field3:val3)" there would be no speedup from the cache, because the new query wouldn't match the previous one at all.

Thanks,
Shawn

Reply via email to