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 Dotan Cohen <do...@gmail.com> on 2013/03/21 16:07:33 UTC

Don't cache filter queries

I need to use the filter query feature to filter my results, but I
don't want the results cached as documents are added to the index
several times per second and the results will be state immediately. Is
there any way to disable filter query caching?

This is on Solr 4.1 running in Jetty on Ubuntu Server. Thanks.

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

Re: Don't cache filter queries

Posted by Dotan Cohen <do...@gmail.com>.
On Thu, Mar 21, 2013 at 6:22 PM, Chris Hostetter
<ho...@fucit.org> wrote:
>
> : Just add {!cache=false} to the filter in your query
> : (http://wiki.apache.org/solr/SolrCaching#filterCache).
>         ...
> : > I need to use the filter query feature to filter my results, but I
> : > don't want the results cached as documents are added to the index
> : > several times per second and the results will be state immediately. Is
> : > there any way to disable filter query caching?
>
> Or remove the filterCache config option from your solrconfig.xml if you
> really don't want any caching of any filter queries.
>
> Fnrakly though: that's throwing the baby out with the bath water -- just
> because you are updating your index super-fast-like doesn't mean you
> aren't getting benefts from the caches, particularly from commonly
> reused filters which are applied to many qureies which might get
> executed concurrently -- not to entnion that a single filter might be
> reused multiple times within a single request to solr.
>
> disabling cache *warming* can make a lot of sense in NRT cases, but
> eliminating caching alltogether rarely does.
>

Thanks. The problem is that the queries with filter queries are taking
much longer to run (~60-80 ms) than the queries without (~1-4 ms). I
figured that the problem may have been with the caching.

In fact, running a query with a filter query and caching disabled is
running in the range of 16-30 ms, which is quite an improvement.

Thanks.


-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

Re: Don't cache filter queries

Posted by Chris Hostetter <ho...@fucit.org>.
: Just add {!cache=false} to the filter in your query
: (http://wiki.apache.org/solr/SolrCaching#filterCache).
	...
: > I need to use the filter query feature to filter my results, but I
: > don't want the results cached as documents are added to the index
: > several times per second and the results will be state immediately. Is
: > there any way to disable filter query caching?

Or remove the filterCache config option from your solrconfig.xml if you
really don't want any caching of any filter queries.

Fnrakly though: that's throwing the baby out with the bath water -- just 
because you are updating your index super-fast-like doesn't mean you 
aren't getting benefts from the caches, particularly from commonly 
reused filters which are applied to many qureies which might get 
executed concurrently -- not to entnion that a single filter might be 
reused multiple times within a single request to solr.

disabling cache *warming* can make a lot of sense in NRT cases, but 
eliminating caching alltogether rarely does.


-Hoss

Re: Don't cache filter queries

Posted by Rafał Kuć <r....@solr.pl>.
Hello!

Just add {!cache=false} to the filter in your query
(http://wiki.apache.org/solr/SolrCaching#filterCache).

-- 
Regards,
 Rafał Kuć
 Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch - ElasticSearch

> I need to use the filter query feature to filter my results, but I
> don't want the results cached as documents are added to the index
> several times per second and the results will be state immediately. Is
> there any way to disable filter query caching?

> This is on Solr 4.1 running in Jetty on Ubuntu Server. Thanks.