kibana/test
Felix Stürmer cf16b801fd
[Context view] Incrementally increase context time window (#16878)
This PR tries to reduce the Elasticsearch cluster load for index patterns with many indices.

**Theory of operation**

Before this PR, Elasticsearch had to perform the query and sorting for every shard matching the index pattern. In order to avoid that in a time-base indexing scheme, the queries should include a `range` filter. This enables Elasticsearch to rewrite most of the shard accesses to `match_none`. But since the context view operates on document counts, the time intervals need to be determined heuristically:

* start of the interval is the second end of the previous query iteration or `anchor_time` if it is the first iteration
* end of the interval is `interval_start +/- n days` with `n in {1, 7, 30, 365, 10000}` or unlimited if insufficient hits were returned for all `n`

This date arithmetic introduces the assumption that the primary sorting field is a date or at least numeric. Therefore, the `sortingField` has been renamed to `timeField` to make those new assumptions explicit.

**Other notes**

As an additional optimization, the queries are now executed in a `constant_score` filter context to enable caching by Elasticsearch.

Tests for `fetchSuccessors` and `fetchPredecessors` were added.

Changes in ElasticSearch required a concurrent fix of #17696, which is also included. It now splits up the anchor `uid` into `anchorType` and `anchorId` and uses them in an `ids` query.

**Testing**

The fact that only a small subset of the shards are involved in a query should be observable using the `skipped` shard count in the response.

fixes #15143
fixes #17696
2018-06-18 12:31:54 +02:00
..
api_integration [Saved Objects Client] Return info about what was missing in the 404 (#19868) 2018-06-15 16:14:04 -07:00
common Change tryForTime error output from 'failure' to 'error', to make it easier to grep the logs for actual failures. (#19707) 2018-06-12 17:19:50 -07:00
dev_certs [devServer] include self-signed certificates for testing 2016-01-19 14:19:25 -07:00
functional [Context view] Incrementally increase context time window (#16878) 2018-06-18 12:31:54 +02:00
scripts [mocha] remove grunt-simple-mocha (#19079) 2018-05-16 10:43:55 -07:00