Difference in filters


(Joaquin Cuenca Abela) #1

Hi,

is there any significant difference in performance between having a
term filter on a not analyzed property, and having a fquery filter on
an analyzed property with _cache = true, if the analyzer is only
asciifolding and lowercasing and the property is always a single word?

Another related question, if the only goal of fquery is to wrap a
query in a filter and cache the results, why can't the syntax be:

{ 'fquery': { 'query_string': { ... } } }

Instead of the more verbose:

{ 'fquery': {
'query: { 'query_string': { ... } },
'_cache': true }
}

--
Joaquin Cuenca Abela -- presspeople.com: Fuentes de prensa y comunicados


(Shay Banon) #2

It will be very similar (there will be additional cost for parsing the query string and applying the analysis each time, but should be pretty fast).

The reason for the more "complex" structure of filtered query is so you can define the _cache parameter (and others).
On Friday, March 25, 2011 at 11:11 AM, Joaquin Cuenca Abela wrote:

Hi,

is there any significant difference in performance between having a
term filter on a not analyzed property, and having a fquery filter on
an analyzed property with _cache = true, if the analyzer is only
asciifolding and lowercasing and the property is always a single word?

Another related question, if the only goal of fquery is to wrap a
query in a filter and cache the results, why can't the syntax be:

{ 'fquery': { 'query_string': { ... } } }

Instead of the more verbose:

{ 'fquery': {
'query: { 'query_string': { ... } },
'_cache': true }
}

--
Joaquin Cuenca Abela -- presspeople.com: Fuentes de prensa y comunicados


(system) #3