If you are doing term and a range filter you're better off with Bool. If
you're doing a range filter and a geo filter and a query filter you could
see slightly better performance with an And. When in doubt, use bool.
If "now/d" is day granularity instead of being down to the second, then
having a single gte is a little faster. The point of the optimization is to
build the filter so that it stays the same over multiple invocations. Under
some circumstances you may also benefit from chaining range filters inside
of a Bool filter. For example, you may filter our documents for *last 7 days
then apply a last hour filter. That approach will yield better
results for very large dataset if you expect to run the same query and just
page backwards one hour at a time. But if your dataset is relatively small,
having an intermediate range filter will slow down your query a little.
On Wednesday, April 24, 2013 2:03:23 PM UTC-7, Valentin wrote:
On Wednesday, April 24, 2013 11:33:58 PM UTC+2, Taras Shkvarchuk wrote:
If you are doing term and a range filter you're better off with Bool.
If you're doing a range filter and a geo filter and a query filter you
could see slightly better performance with an And. When in doubt, use bool.
If "now/d" is day granularity instead of being down to the second, then
having a single gte is a little faster. The point of the optimization is to
build the filter so that it stays the same over multiple invocations. Under
some circumstances you may also benefit from chaining range filters inside
of a Bool filter. For example, you may filter our documents for last 7
days then apply a last hour filter. That approach will yield better
results for very large dataset if you expect to run the same query and just
page backwards one hour at a time. But if your dataset is relatively small,
having an intermediate range filter will slow down your query a little.
On Wednesday, April 24, 2013 2:03:23 PM UTC-7, Valentin wrote:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.