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 Tim Vaillancourt <ti...@elementspace.com> on 2013/10/17 00:18:32 UTC

Skipping caches on a /select

Hey guys,

I am debugging some /select queries on my Solr tier and would like to see
if there is a way to tell Solr to skip the caches on a given /select query
if it happens to ALREADY be in the cache. Live queries are being inserted
and read from the caches, but I want my debug queries to bypass the cache
entirely.

I do know about the "cache=false" param (that causes the results of a
select to not be INSERTED in to the cache), but what I am looking for
instead is a way to tell Solr to not read the cache at all, even if there
actually is a cached result for my query.

Is there a way to do this (without disabling my caches in solrconfig.xml),
or is this feature request?

Thanks!

Tim Vaillancourt

Re: Skipping caches on a /select

Posted by Tim Vaillancourt <ti...@elementspace.com>.
Awesome, this make a lot of sense now. Thanks a lot guys.

Currently the only mention of this setting in the docs is under 
filterQuery on the "SolrCaching" page as:

"<!> Solr3.4 <http://wiki.apache.org/solr/Solr3.4> Adding the localParam 
flag of {!cache=false} to a query will prevent the filterCache from 
being consulted for that query. "

I will update the docs sometime soon to reflect that this can apply to 
any query (q or fq).

Cheers,

Tim

On 17/10/13 01:44 PM, Chris Hostetter wrote:
>
> : Does "cache=false" apply to all caches? The docs make it sound like it is for
> : filterCache only, but I could be misunderstanding.
>
> it's per *query* -- not per cache, or per request...
>
>   /select?q={!cache=true}foo&fq={!cache=false}bar&fq={!cache=true}baz
>
> ...should cause 1 lookup/insert in the filterCache (baz) and 1
> lookup/insert into the queryResultCache (for the main query with it's
> associated filters&  pagination)
>
>
>
> -Hoss

Re: Skipping caches on a /select

Posted by Chris Hostetter <ho...@fucit.org>.

: Does "cache=false" apply to all caches? The docs make it sound like it is for
: filterCache only, but I could be misunderstanding.

it's per *query* -- not per cache, or per request...

 /select?q={!cache=true}foo&fq={!cache=false}bar&fq={!cache=true}baz

...should cause 1 lookup/insert in the filterCache (baz) and 1 
lookup/insert into the queryResultCache (for the main query with it's 
associated filters & pagination)



-Hoss

Re: Skipping caches on a /select

Posted by Bill Bell <bi...@gmail.com>.
But global on a qt would be awesome !!!

Bill Bell
Sent from mobile


> On Oct 17, 2013, at 2:43 PM, Yonik Seeley <ys...@gmail.com> wrote:
> 
> There isn't a global  "cache=false"... it's a local param that can be
> applied to any "fq" or "q" parameter independently.
> 
> -Yonik
> 
> 
>> On Thu, Oct 17, 2013 at 4:39 PM, Tim Vaillancourt <ti...@elementspace.com> wrote:
>> Thanks Yonik,
>> 
>> Does "cache=false" apply to all caches? The docs make it sound like it is
>> for filterCache only, but I could be misunderstanding.
>> 
>> When I force a commit and perform a /select a query many times with
>> "cache=false", I notice my query gets cached still, my guess is in the
>> queryResultCache. At first the query takes 500ms+, then all subsequent
>> requests take 0-1ms. I'll confirm this queryResultCache assumption today.
>> 
>> Cheers,
>> 
>> Tim
>> 
>> 
>>> On 16/10/13 06:33 PM, Yonik Seeley wrote:
>>> 
>>> On Wed, Oct 16, 2013 at 6:18 PM, Tim Vaillancourt<ti...@elementspace.com>
>>> wrote:
>>>> 
>>>> I am debugging some /select queries on my Solr tier and would like to see
>>>> if there is a way to tell Solr to skip the caches on a given /select
>>>> query
>>>> if it happens to ALREADY be in the cache. Live queries are being inserted
>>>> and read from the caches, but I want my debug queries to bypass the cache
>>>> entirely.
>>>> 
>>>> I do know about the "cache=false" param (that causes the results of a
>>>> select to not be INSERTED in to the cache), but what I am looking for
>>>> instead is a way to tell Solr to not read the cache at all, even if there
>>>> actually is a cached result for my query.
>>> 
>>> Yeah, cache=false for "q" or "fq" should already not use the cache at
>>> all (read or write).
>>> 
>>> -Yonik

Re: Skipping caches on a /select

Posted by Yonik Seeley <ys...@gmail.com>.
There isn't a global  "cache=false"... it's a local param that can be
applied to any "fq" or "q" parameter independently.

-Yonik


On Thu, Oct 17, 2013 at 4:39 PM, Tim Vaillancourt <ti...@elementspace.com> wrote:
> Thanks Yonik,
>
> Does "cache=false" apply to all caches? The docs make it sound like it is
> for filterCache only, but I could be misunderstanding.
>
> When I force a commit and perform a /select a query many times with
> "cache=false", I notice my query gets cached still, my guess is in the
> queryResultCache. At first the query takes 500ms+, then all subsequent
> requests take 0-1ms. I'll confirm this queryResultCache assumption today.
>
> Cheers,
>
> Tim
>
>
> On 16/10/13 06:33 PM, Yonik Seeley wrote:
>>
>> On Wed, Oct 16, 2013 at 6:18 PM, Tim Vaillancourt<ti...@elementspace.com>
>> wrote:
>>>
>>> I am debugging some /select queries on my Solr tier and would like to see
>>> if there is a way to tell Solr to skip the caches on a given /select
>>> query
>>> if it happens to ALREADY be in the cache. Live queries are being inserted
>>> and read from the caches, but I want my debug queries to bypass the cache
>>> entirely.
>>>
>>> I do know about the "cache=false" param (that causes the results of a
>>> select to not be INSERTED in to the cache), but what I am looking for
>>> instead is a way to tell Solr to not read the cache at all, even if there
>>> actually is a cached result for my query.
>>
>> Yeah, cache=false for "q" or "fq" should already not use the cache at
>> all (read or write).
>>
>> -Yonik

Re: Skipping caches on a /select

Posted by Tim Vaillancourt <ti...@elementspace.com>.
Thanks Yonik,

Does "cache=false" apply to all caches? The docs make it sound like it 
is for filterCache only, but I could be misunderstanding.

When I force a commit and perform a /select a query many times with 
"cache=false", I notice my query gets cached still, my guess is in the 
queryResultCache. At first the query takes 500ms+, then all subsequent 
requests take 0-1ms. I'll confirm this queryResultCache assumption today.

Cheers,

Tim

On 16/10/13 06:33 PM, Yonik Seeley wrote:
> On Wed, Oct 16, 2013 at 6:18 PM, Tim Vaillancourt<ti...@elementspace.com>  wrote:
>> I am debugging some /select queries on my Solr tier and would like to see
>> if there is a way to tell Solr to skip the caches on a given /select query
>> if it happens to ALREADY be in the cache. Live queries are being inserted
>> and read from the caches, but I want my debug queries to bypass the cache
>> entirely.
>>
>> I do know about the "cache=false" param (that causes the results of a
>> select to not be INSERTED in to the cache), but what I am looking for
>> instead is a way to tell Solr to not read the cache at all, even if there
>> actually is a cached result for my query.
> Yeah, cache=false for "q" or "fq" should already not use the cache at
> all (read or write).
>
> -Yonik

Re: Skipping caches on a /select

Posted by Yonik Seeley <ys...@gmail.com>.
On Wed, Oct 16, 2013 at 6:18 PM, Tim Vaillancourt <ti...@elementspace.com> wrote:
> I am debugging some /select queries on my Solr tier and would like to see
> if there is a way to tell Solr to skip the caches on a given /select query
> if it happens to ALREADY be in the cache. Live queries are being inserted
> and read from the caches, but I want my debug queries to bypass the cache
> entirely.
>
> I do know about the "cache=false" param (that causes the results of a
> select to not be INSERTED in to the cache), but what I am looking for
> instead is a way to tell Solr to not read the cache at all, even if there
> actually is a cached result for my query.

Yeah, cache=false for "q" or "fq" should already not use the cache at
all (read or write).

-Yonik