On Wed, Apr 22, 2015 at 2:41 PM, Ed Kim <edki...@gmail.com> wrote:

> Hi, I have a dynamic query built via java api that assembles a filtered
> query depending on the parameter input. I have about a dozen filters
> (mostly term filters) that may or may not be used, and had a couple
> questions:
>
> 1. Is it ok to simply set the parent boolFilterBuilder cache setting to
> true, or do I need to set cache=true for each filter?
>

Those do different things. One caches the combined results and one caches
each term. To be honest term filter are rarely worth caching because just
hitting lucene for them is so fast.

2. Would it be a good practice to execute a dummy query with all the
> filters to preemptively create the filter before it's released for actual
> use?
>

This is what warmers are for. They are applied to new segments to eagerly
load stuff including the filter cache. Elasticsearch's filer cache is per
segment so this is a good match. Its also why the filter cache doesn't have
to be invalidated - segments are write only and deletes are applied after
the results from the filter cache.

Nik

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0VNMNL3MZQ%2BAHn5EH4N%3DQRpqjS9UqQMEZ-yY82C4-ozA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to