OpenSearch/docs/reference
uboness 7d6ad8d91c Added extended_bounds support for date_/histogram aggs
By default the date_/histogram returns all the buckets within the range of the data itself, that is, the documents with the smallest values (on which with histogram) will determine the min bucket (the bucket with the smallest key) and the documents with the highest values will determine the max bucket (the bucket with the highest key). Often, when when requesting empty buckets (min_doc_count : 0), this causes a confusion, specifically, when the data is also filtered.

To understand why, let's look at an example:

Lets say the you're filtering your request to get all docs from the last month, and in the date_histogram aggs you'd like to slice the data per day. You also specify min_doc_count:0 so that you'd still get empty buckets for those days to which no document belongs. By default, if the first document that fall in this last month also happen to fall on the first day of the **second week** of the month, the date_histogram will **not** return empty buckets for all those days prior to that second week. The reason for that is that by default the histogram aggregations only start building buckets when they encounter documents (hence, missing on all the days of the first week in our example).

With extended_bounds, you now can "force" the histogram aggregations to start building buckets on a specific min values and also keep on building buckets up to a max value (even if there are no documents anymore). Using extended_bounds only makes sense when min_doc_count is 0 (the empty buckets will never be returned if the min_doc_count is greater than 0).

Note that (as the name suggest) extended_bounds is **not** filtering buckets. Meaning, if the min bounds is higher than the values extracted from the documents, the documents will still dictate what the min bucket will be (and the same goes to the extended_bounds.max and the max bucket). For filtering buckets, one should nest the histogram agg under a range filter agg with the appropriate min/max.

Closes #5224
2014-03-20 14:48:27 +01:00
..
analysis [DOCS] Fixed some bad UTF8 2014-03-19 12:46:06 +01:00
cat Add _cat/plugins endpoint 2014-03-16 12:16:09 +01:00
cluster Add docs for plugin isolation 2014-03-11 12:32:58 +02:00
docs Introduced VersionType.FORCE & VersionType.EXTERNAL_GTE 2014-03-10 21:07:17 +01:00
images [Doc] Add a chart about the relative error of the percentiles aggregation. 2014-03-14 12:23:23 +01:00
index-modules Move to use serial merge schedule by default 2014-03-18 13:17:00 +01:00
indices Add an option to force _optimize operations. 2014-03-14 18:21:56 +01:00
mapping [DOCS] Documented the fact that binary fields are not stored by default 2014-03-20 12:43:43 +01:00
migration [DOCS] Included the `_percolator` index breaking change to migration docs. 2014-02-20 16:43:06 +01:00
modules [Doc] Updated docs for distance scripting 2014-03-20 12:18:25 +01:00
query-dsl [DOCS] Formatting error 2014-03-05 17:40:51 +01:00
search Added extended_bounds support for date_/histogram aggs 2014-03-20 14:48:27 +01:00
setup [DOCS] Fix typo in the reference doc. SuSe -> SUSE 2014-03-17 12:03:25 +01:00
testing [TEST] Randomized number of shards used for indices created during tests 2014-03-10 13:01:52 +01:00
analysis.asciidoc Add more anchor links to documentation 2013-09-30 13:13:16 -06:00
api-conventions.asciidoc Added the `DistanceUnit.NAUTICALMILES` enumeration 2014-02-14 19:48:58 +09:00
cat.asciidoc Add _cat/plugins endpoint 2014-03-16 12:16:09 +01:00
cluster.asciidoc [DOCS] Fix HTTP endpoints after stats API changes 2014-01-09 11:30:28 +01:00
docs.asciidoc [DOCS] Moved termvector and mtermvectors from search to docs 2014-01-22 14:10:26 +01:00
glossary.asciidoc Migrated documentation into the main repo 2013-08-29 01:24:34 +02:00
index-modules.asciidoc Removed 0.90.* deprecation and addition notifications 2014-02-07 20:52:49 +01:00
index.asciidoc [DOCS] Added breaking changes in 1.0 2014-01-15 17:50:24 +01:00
indices.asciidoc Add a GetFieldMapping API 2013-10-30 16:16:36 +01:00
mapping.asciidoc [DOCS] Moved multi fields documentation into the core-types page 2014-01-22 10:05:58 +01:00
modules.asciidoc [DOCS] Fixed link to tribe.asciidoc 2014-01-13 22:01:12 +01:00
query-dsl.asciidoc Migrated documentation into the main repo 2013-08-29 01:24:34 +02:00
search.asciidoc [DOCS] Moved termvector and mtermvectors from search to docs 2014-01-22 14:10:26 +01:00
setup.asciidoc [DOCS] Make apt/yum repos more visible 2014-02-06 17:04:37 +01:00
testing.asciidoc [DOCS] Test framework documentation 2013-12-02 18:01:45 +01:00