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 J Mohamed Zahoor <za...@indix.com> on 2013/05/20 13:53:20 UTC

cache disable through solrJ

Hi

How do i disable cache (Solr FieldValueCache) for certain queries...
using HTTP it can be done using {!cache=false}... 

how can i do it from solrj?

./zahoor

Re: cache disable through solrJ

Posted by Shawn Heisey <so...@elyograg.org>.
On 5/20/2013 5:53 AM, J Mohamed Zahoor wrote:
> How do i disable cache (Solr FieldValueCache) for certain queries...
> using HTTP it can be done using {!cache=false}... 

If you are doing facets, Koji's reply works for those.

The localparam for caching should work just fine if you prepend it to
your query string before you add it to your query object in SolrJ.

query.addFilterQuery("{!cache=false}instock:true");

If this is what you have tried, be sure that you don't use
ClientUtils.escapeQueryChars to escape the prepended localparam, or it
will become part of your query text rather than the special cache
instruction.  You can run it on the query parts, of course.

If it still doesn't work, check the Solr log for what parameters get
sent with the http query and with the solrj query.

Thanks,
Shawn


Re: cache disable through solrJ

Posted by Koji Sekiguchi <ko...@r.email.ne.jp>.
(13/05/20 20:53), J Mohamed Zahoor wrote:
> Hi
>
> How do i disable cache (Solr FieldValueCache) for certain queries...
> using HTTP it can be done using {!cache=false}...
>
> how can i do it from solrj?
>
> ./zahoor
>

How about using facet.method=enum?

koji
-- 
http://soleami.com/blog/lucene-4-is-super-convenient-for-developing-nlp-tools.html