You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by richardg <ri...@dvdempire.com> on 2012/11/28 22:20:23 UTC

Excluding caching of queryresult

We are aware of adding cache=false to our queries but everything we see seems
to reference filterCache.  We weren't sure if this parameter would work the
same way with the queryResultsCache.  Here is an example of a query we don't
want to cache(NOTE: I'm just the administrator, I'm not so familiar w/ query
construction):

Currently it is constructed as: &fq=doc_type:%22Cast%22&q=id:48880

We want to rewrite as: &q=*:*&fq={!cache=false}(doc_type:"Cast" AND
id:"48880")  

As such I believe it would not cache the filter, would this also not cache
the queryResult or would it need to be written another way:


&q={!cache=false}(*:*)&fq={!cache=false}(doc_type:"Cast" AND id:"48880")  

Or is it not possible to exclude thing from the queryCache?




--
View this message in context: http://lucene.472066.n3.nabble.com/Excluding-caching-of-queryresult-tp4023105.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Excluding caching of queryresult

Posted by Erick Erickson <er...@gmail.com>.
Ahhh, good to know. Since that capability really was intended for filter
caches, in particular "expensive" operations like ACL control I'd really
never considered it's effects on other caches and didn't look to see if it
was inserted in the code specific to filter caches or at a level that would
apply to other caches as well. Apparently the latter is true...

Thanks for posting the results!

Best
Erick


On Thu, Nov 29, 2012 at 9:45 AM, richardg <ri...@dvdempire.com> wrote:

> Using cache=false seems to Not be caching the query result. I ran queries
> against our master server that doesn't get web traffic with and without the
> parameter and would only notice inserts when the parameter wasn't included.
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Excluding-caching-of-queryresult-tp4023105p4023241.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Excluding caching of queryresult

Posted by richardg <ri...@dvdempire.com>.
Using cache=false seems to Not be caching the query result. I ran queries
against our master server that doesn't get web traffic with and without the
parameter and would only notice inserts when the parameter wasn't included.



--
View this message in context: http://lucene.472066.n3.nabble.com/Excluding-caching-of-queryresult-tp4023105p4023241.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Excluding caching of queryresult

Posted by richardg <ri...@dvdempire.com>.
Thanks Erick, I just found this ticket implying that is able to be used by
the main query also:

https://issues.apache.org/jira/browse/SOLR-2429
<https://issues.apache.org/jira/browse/SOLR-2429>  

As you stated queryResultCache is cheap, I guess it would nice to get a
definitive answer and example as it would be used for other caches.



--
View this message in context: http://lucene.472066.n3.nabble.com/Excluding-caching-of-queryresult-tp4023105p4023233.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Excluding caching of queryresult

Posted by Erick Erickson <er...@gmail.com>.
setting cache to false is, as far as I know, only possible on filter
queries.

Do note that the queryResultCache is very cheap. All it is is a map where
the
key is the query and the value is int[windowsize] where windowsize is
the value in solrconfig.xml (queryResultWindowSize). It's primarily used
for paging,
so I don't think that you would be able to even measure the difference if it
was able to be disabled.

Best
Erick


On Wed, Nov 28, 2012 at 4:20 PM, richardg <ri...@dvdempire.com> wrote:

> We are aware of adding cache=false to our queries but everything we see
> seems
> to reference filterCache.  We weren't sure if this parameter would work the
> same way with the queryResultsCache.  Here is an example of a query we
> don't
> want to cache(NOTE: I'm just the administrator, I'm not so familiar w/
> query
> construction):
>
> Currently it is constructed as: &fq=doc_type:%22Cast%22&q=id:48880
>
> We want to rewrite as: &q=*:*&fq={!cache=false}(doc_type:"Cast" AND
> id:"48880")
>
> As such I believe it would not cache the filter, would this also not cache
> the queryResult or would it need to be written another way:
>
>
> &q={!cache=false}(*:*)&fq={!cache=false}(doc_type:"Cast" AND id:"48880")
>
> Or is it not possible to exclude thing from the queryCache?
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Excluding-caching-of-queryresult-tp4023105.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>