Bool and and/or filter

Hi,

We're revising our usage of ElasticSearch.
Currently we use and/or filter to glue multiple filters together, but after
some reading on the documentation I wonders if it's better to use bool.

As far as I understand, bool filters uses a bitmap approach, that is
sub-filters returns bitmaps and an and binary operation is applied on all
partial bitmaps to obtain the result.
And for and/or query, it's more an iterator approach, a stream of documents
comes in, pass over all filters and finally filtered document stream comes
out.

I've read in the internal filter operation part, it says that filter
results are cached in the form of bitmaps. So does it means that bool
filter can benefit from the cache, while and/or filter cannot?
In general how do we choose between bool filter and and/or filter?

Thanks!

--
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/739206ed-e408-4942-8a25-32f75273a65d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

You should read this: Elasticsearch Platform — Find real-time answers at scale | Elastic http://www.elasticsearch.org/blog/all-about-elasticsearch-filter-bitsets/

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr https://twitter.com/elasticsearchfr | @scrutmydocs https://twitter.com/scrutmydocs

Le 17 déc. 2014 à 11:06, Han JU ju.han.felix@gmail.com a écrit :

Hi,

We're revising our usage of Elasticsearch.
Currently we use and/or filter to glue multiple filters together, but after some reading on the documentation I wonders if it's better to use bool.

As far as I understand, bool filters uses a bitmap approach, that is sub-filters returns bitmaps and an and binary operation is applied on all partial bitmaps to obtain the result.
And for and/or query, it's more an iterator approach, a stream of documents comes in, pass over all filters and finally filtered document stream comes out.

I've read in the internal filter operation part, it says that filter results are cached in the form of bitmaps. So does it means that bool filter can benefit from the cache, while and/or filter cannot?
In general how do we choose between bool filter and and/or filter?

Thanks!

--
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 mailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/739206ed-e408-4942-8a25-32f75273a65d%40googlegroups.com https://groups.google.com/d/msgid/elasticsearch/739206ed-e408-4942-8a25-32f75273a65d%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout https://groups.google.com/d/optout.

--
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/72A856DD-790D-464F-94B3-EAF53FF7FD59%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

Oh thanks David ..
Maybe add some information in the and/or filter documentation page.

在 2014年12月17日星期三UTC+1上午11时10分39秒,David Pilato写道:

You should read this:
Elasticsearch Platform — Find real-time answers at scale | Elastic

--
David Pilato | Technical Advocate | Elasticsearch.com
http://Elasticsearch.com

@dadoonet https://twitter.com/dadoonet | @elasticsearchfr
https://twitter.com/elasticsearchfr | @scrutmydocs
https://twitter.com/scrutmydocs

Le 17 déc. 2014 à 11:06, Han JU <ju.han...@gmail.com <javascript:>> a
écrit :

Hi,

We're revising our usage of Elasticsearch.
Currently we use and/or filter to glue multiple filters together, but
after some reading on the documentation I wonders if it's better to use
bool.

As far as I understand, bool filters uses a bitmap approach, that is
sub-filters returns bitmaps and an and binary operation is applied on all
partial bitmaps to obtain the result.
And for and/or query, it's more an iterator approach, a stream of
documents comes in, pass over all filters and finally filtered document
stream comes out.

I've read in the internal filter operation part, it says that filter
results are cached in the form of bitmaps. So does it means that bool
filter can benefit from the cache, while and/or filter cannot?
In general how do we choose between bool filter and and/or filter?

Thanks!

--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/739206ed-e408-4942-8a25-32f75273a65d%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/739206ed-e408-4942-8a25-32f75273a65d%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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/6f12b81c-5602-4496-a871-283025eb9c21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

AFAIK things are subject to change in ES 2.0 and may be only bool will remain.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 17 déc. 2014 à 15:45, Han JU ju.han.felix@gmail.com a écrit :

Oh thanks David ..
Maybe add some information in the and/or filter documentation page.

在 2014年12月17日星期三UTC+1上午11时10分39秒,David Pilato写道:

You should read this: Elasticsearch Platform — Find real-time answers at scale | Elastic

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 17 déc. 2014 à 11:06, Han JU ju.han...@gmail.com a écrit :

Hi,

We're revising our usage of Elasticsearch.
Currently we use and/or filter to glue multiple filters together, but after some reading on the documentation I wonders if it's better to use bool.

As far as I understand, bool filters uses a bitmap approach, that is sub-filters returns bitmaps and an and binary operation is applied on all partial bitmaps to obtain the result.
And for and/or query, it's more an iterator approach, a stream of documents comes in, pass over all filters and finally filtered document stream comes out.

I've read in the internal filter operation part, it says that filter results are cached in the form of bitmaps. So does it means that bool filter can benefit from the cache, while and/or filter cannot?
In general how do we choose between bool filter and and/or filter?

Thanks!

--
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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/739206ed-e408-4942-8a25-32f75273a65d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/6f12b81c-5602-4496-a871-283025eb9c21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/1B11F351-2542-437E-9DBE-64E2FE701515%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.