The fastest filter under the sun?


(José de Zárate) #1

which is the fastest possible filter I could use to exclude documents from
a search, provided that I have control of what fields those documents have?

in an ecommerce search engine, we used to not to index products that were
"out of stock". however, if for some reason the ecommerce owner wants to
show the "out of stock" products, she has to reindex them again.

following a tip from Igor Motov in another thread, I'm considering adding
some "out_of_stock" field to every item, let them all be indexed, and use a
filtered alias.

since I have control on the field I'm using for filtering, I figured I
could use the one that allows me "the fastest filter under the sun".

I've assumed that would be the "missing field" filter, with
"existence:True". i.e. only the documents that don't have the
"out_of_stock" field pass the filter (I don't mind the field's value)

Am I right? is this the fastest/more performant filter I can use?

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/ffae84ea-957c-4ecf-b5f1-9a1456437860%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Binh Ly) #2

I wouldn't worry too much about this. Once the filter is cached, they
should all behave about the same. What should matter to you is if the
filter is cached or not. This should give you an idea of how to decide what
filters to use:

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/930df8cc-c955-44e2-b4bb-fd6f75603b76%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(José de Zárate) #3

txs. binh. I have a new concern now, though, which is if, in the light
of the blog post you mentioned, I should wrap my only "missing" filter
inside a "bool" filter.

On Tue, Feb 18, 2014 at 1:45 PM, Binh Ly binh@hibalo.com wrote:

I wouldn't worry too much about this. Once the filter is cached, they should
all behave about the same. What should matter to you is if the filter is
cached or not. This should give you an idea of how to decide what filters to
use:

http://www.elasticsearch.org/blog/all-about-elasticsearch-filter-bitsets/

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/rZRGyK1Od8I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/930df8cc-c955-44e2-b4bb-fd6f75603b76%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
uh, oh.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKNaH0X7fJgJdnzs3M3zQ%2Bg9wRHkLq4k%2B2cBA4RgBGfMQk%2By4w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #4