Commit Graph

2508 Commits

Author SHA1 Message Date
Dimitris Athanasiou 83395d96d3
Mute point-in-time with slicing YAML test (#75222)
Relates #75212
2021-07-12 12:47:15 +03:00
Przemyslaw Gomulka 1855782def
[Rest Api Compatibility] Allow copy_settings flag for resize operations (#75184)
previously removed in #38514, deprecated in 7.x and defaulted to true.
With rest api compatibility and when value is true it is ignored and warning is emitted
when value is false, an exception is thrown

relates #51816
2021-07-12 10:55:24 +02:00
Przemyslaw Gomulka 563e1fb8e1
[Rest Api Compatibility] Return adjust_pure_negative values (#75182)
the adjust_pure_negative value used to be always present in to_xcontent
response, but it was changed in #49543 to only serialise this field when
the value is false

relates #51816
2021-07-12 09:34:25 +02:00
Julie Tibshirani c9c5d1f84c Adjust version checks after sliced PIT backport 2021-07-09 12:24:20 -07:00
Przemyslaw Gomulka 1b0ef6a5de
[Rest Api Compatibility] Dummy REST action for indices.upgrade api (#75136)
indices upgrade api (/_upgrade or /{index}/_upgrade) was removed and _reindex is suggested to be used instead.
There is no easy way to translate _upgrade request to _reindex requests. The dummy Upgrade action will return an exception to a user with a message indicating that _reindex should be used.

upgrade api removal #64732
relates #51816
2021-07-09 10:44:45 +02:00
Julie Tibshirani cdf67e0fd5
Support search slicing with point-in-time (#74457)
This PR adds support for using the `slice` option in point-in-time searches. By
default, the slice query splits documents based on their Lucene ID. This
strategy is more efficient than the one used for scrolls, which is based on the
`_id` field and must iterate through the whole terms dictionary. When slicing a
search, the same point-in-time ID must be used across slices to guarantee the
partitions don't overlap or miss documents.

Closes #65740.
2021-07-08 15:33:41 -07:00
Przemyslaw Gomulka 1f726800a6
[Rest Api Compatibility] Clean up x-pack/plugin rest compat tests (#74701)
this PR removes tests which are not meant to be fixed (ml/, vectors/) to a separate "not to be fixed list" so that we can see which compatible changes are meant to be implemented.

relates #51816
2021-07-08 11:04:55 +02:00
Nhat Nguyen 55abeae683
Remove AwaitsFix in field collapsing yaml tests (#75087)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-07-07 16:27:22 -04:00
Steve Gordon 6bc064a0ff
Deprecate freeze and unfreeze indices endpoints in REST API specification (#75042)
* Deprecate frozen indices endpoint
* Improve description to match warning
* Deprecate unfreeze indices in REST API specs
2021-07-07 15:17:44 +01:00
James Rodewig 559e40fdb9
[DOCS] Fix stability and doc URL for rollup V2 JSON spec (#74992) 2021-07-06 12:32:21 -04:00
Przemyslaw Gomulka 72a58bc338
[Rest Api Compatibility] _time and _term sort orders (#74919)
Previously removed in #39450, deprecated in es6 but not removed in es 7.
defaults to _key behaviour

relates #51816
2021-07-06 15:06:26 +02:00
Nhat Nguyen dc60a3880c Adjust BWC test version for disk usage API
Relates #74051
2021-07-01 07:57:02 -04:00
James Rodewig 3d1cb4944d
[DOCS] Overhaul search template docs (#72583)
Changes:

* Adds a tutorial for search templates.
* Adds reference docs for the render search template API.
* Improves parameter documentation for the multi search template API.
* Removes duplicate examples from the search template API, multi search API, and create stored script API docs.
* Splits the source files for the search template API and the multi search template API docs.
2021-06-30 16:03:49 -04:00
Nhat Nguyen c23cb99b71
Add index disk usage API (#74051)
This change adds a new API that supports analyzing the disk usage of 
each field of an index.
2021-06-30 11:50:01 -04:00
Andrei Dan 5ca240eabd
Add `dry_run` support to the migrate to data tiers API (#74639)
This adds support for a `dry_run` parameter for the
`_ilm/migrate_to_data_tiers` API. This defaults to `false`, but when
configured to `true` it will simulate the migration of elasticsearch
entities to data tiers based routing, returning the entites that need to
be updated (indices, ILM policies and the legacy index template that'd
be deleted, if any was configured in the request).
2021-06-29 10:37:16 +01:00
Przemyslaw Gomulka 5ac94b5263
[Rest Api Compatibility] Enable tests that are already fixed (#74174)
With types removal changes being available under rest api compatibility I have removed the block entries for tests which are already fixed
relates #51816
2021-06-29 09:11:31 +02:00
Nik Everett d251d742aa
Lock test to single shard index (#74627)
The filter by filter terms aggregation optimization only kicks in when
its targeting a non-empty shard. An empty shard is fast to collect no
matter what so there isn't really any need to do anything complex.
Anyway, this locks the test to a single sharded index so there isn't a
chance of the debugging data coming back from an empty shard. Which
would cause the test to fail because its expecting the optimization to
run.

Closes #74612
2021-06-28 10:35:53 -04:00
Andrei Dan 636aa7c0da
Add migrate to data tiers API (#74264)
This adds the _ilm/migrate_to_data_tiers API to expose the service for
migrating the elasticsearch abstractions (indices, ILM policies and an 
optional legacy template to delete) to data tiers routing allocation 
(away from custom node attributes)
2021-06-28 12:07:39 +01:00
Przemyslaw Gomulka 90f22717b1
[Rest Api Compatibility] Typed TermLookups (#74544)
Previously removed in #46943
parsing type field in term lookup is now possible with rest
compatible api. The type field is ignored

relates main meta issue #51816
relates type removal meta issue #54160
2021-06-28 12:03:39 +02:00
Armin Braun cbf48e0633
Flatten Get Snapshots Response (#74451)
This PR returns the get snapshots API to the 7.x format (and transport client behavior) and enhances it for requests that ask for multiple repositories.
The changes for requests that target multiple repositories are:
* Add `repository` field to `SnapshotInfo` and REST response
* Add `failures` map alongside `snapshots` list instead of returning just an exception response as done for single repo requests
* Pagination now works across repositories instead of being per repository for multi-repository requests

closes #69108
closes #43462
2021-06-24 16:58:33 +02:00
Nik Everett a5af44d413
Disable optimization if we aren't sure its faster (#74260)
This disables the filter-by-filter aggregation optimization used by
`terms`, `range`, `date_histogram`, and `date_range` aggregations unless
we're *sure* that its faster than the "native" implementation. Mostly this
is when the top level query is empty or we can merge it into the filter
generated by the agg rewrite process.

Now that we have hard and fast rules we can drop the cost estimation
framework without too much fear. So we remove it in this change. It
stomps a bunch of complexity. Sadly, without the cost estimation stuff
we have to add a separate mechanism for blocking the optimization
against runtime fields for which it'd be kind of garbage. For that I
added another rule preventing the filter-by-filter aggregation from
running against the queries made by runtime fields. Its not fool-proof,
but we have control over what queries we pass as a filter so its not
wide open.

I spent a lot of time working on an alternative to this that preserved
that fancy filter-by-filter collection mechanism and was much more kind
to the query cache. It detected cases where going full filter-by-filter
was bad and grouped those filters together to collect in one pass with a
funny ORing collector. It *worked*. And, if we were super concerned with
the performance of the `filters` aggregation it'd be the way to go. But
it was very complex and it was actually slower than using the native
aggregation for things like `terms` and `date_histogram`. It was
glorious. But it was wrong for us. Too complex and optimized the wrong
things.

So here we are. Hopefully this is a fairly simple solution to a sneaky
problem.
2021-06-24 08:56:01 -04:00
Przemyslaw Gomulka dd7d37c54a
[Rest Api Compatibility] Ignore use_field_mapping option for docvalue (#74435)
previously removed in #55622 use_field_mapping option can be used on doc
value format under rest api compatibility.
The value itself is ignored (replaced with null) as it is a default
behaviour to use field mapping format.

relates https://github.com/elastic/elasticsearch/issues/51816
2021-06-24 08:56:42 +02:00
Ioannis Kakavas 6887604f17
Add REST API specification for SAML APIs (#72839)
These API specifications were originally not added as we considered 
them internal.
2021-06-24 09:29:43 +03:00
Mark Tozzi d9259ccb3f
Fix BWC version on tests after backport (#74515) 2021-06-23 17:11:45 -04:00
Ioannis Kakavas 82e7fbda53
Add the Enroll Kibana API (#72207)
This change adds the Enroll Kibana API that enables a Kibana instance to
configure itself to communicate with a secured elasticsearch cluster
2021-06-23 22:58:46 +03:00
Benjamin Trent 0303e6d733
[ML] add datafeed field to the job config (#74265)
This is a quality of life improvement for typical users. Almost all anomaly jobs will receive their data through a datafeed.

The datafeed config can now be supplied and is available in the datafeed field in the job config for creation and getting jobs.
2021-06-23 08:06:58 -04:00
Przemyslaw Gomulka 5d4dbea26a
[Rest Api Compatibility] Indicies boost in object format (#74422)
Previously removed #55078 indices_boost field is available when used
with rest api compatibility

relates #51816
2021-06-23 09:27:28 +02:00
Julie Tibshirani bcab641ed2
Adjust some skip versions after backport (#74389)
We forgot to update some skip versions in REST tests after backports. This PR
only targets search tests.
2021-06-22 15:58:02 -07:00
Mark Tozzi cd2732d40b
Fail composite aggregation if after key is unparsable (#74252)
If the after key cannot parse back to the same value we generated it from, when the client sends it back we will land on a wrong page.  If this page is earlier, it is likely we will (eventually) generate the same wrong after key, resulting in an infinite loop as the client repeatedly ask to retrieve the same page or pages of data.  This change fixes that by failing the composite aggregation (with an exception) if the after key is unparsable with the given format.  We provide as much information about what failed as possible.
2021-06-22 15:28:14 -04:00
Lisa Cawley 68c33dc713
[DOCS] Add get user privileges API (#73016) 2021-06-22 08:16:21 -07:00
Nik Everett 826868a934 Fix test assertion
We made a setting to disable an optimization because, sometimes, it
turns out to be slower. The setting gives users an "escape hatch". In
our assertion for the setting we accidently were too specific about the
aggregator we expected to run so the test would sometimes fail
spuriously. This loosens the assertion. While we're at it, it also adds
an assertion that the optimization is enabled by default.

Closes #74374
2021-06-22 08:38:42 -04:00
David Kyle 54b75a3208
[ML] Parse timeout in model deployment APIs (#74170)
Respect the timeout parameter for _infer and deployment _start APIs
2021-06-18 08:28:37 +01:00
Przemyslaw Gomulka fdc301f045
[Rest Api Compatibility] Typed indexing stats (#74181)
the per type indexing stats is simplified and when _types is requested
it will return total stats for the index repeated under types/_doc/

the removal #47203

relates main meta issue #51816
relates types removal issue #54160
2021-06-17 14:21:21 +02:00
Dan Hermann 74ea21622f
Mute failing MixedClusterClientYamlTestSuiteIT test {p0=indices.split/20_source_mapping/Split index ignores target template mapping} test (#74198) 2021-06-16 11:34:48 -05:00
Mark Tozzi e6c5688c82
Fix bug when formatting epoch dates (#73955)
Date based aggregations accept a timezone, which gets applied to both the bucketing logic and the formatter. This is usually what you want, but in the case of date formats where a timezone doesn't make any sense, it can create problems. In particular, our formatting logic and our parsing logic were doing different things for epoch_second and epoch_millis formats with time zones. This led to a problem on composite where we'd return an after key for the last bucket that would parse to a time before the last bucket, so instead of correctly returning an empty response to indicate the end of the aggregation, we'd keep returning the same last page of data.
2021-06-15 12:20:43 -04:00
Dimitris Athanasiou dc61a72c9e
[ML] Reset anomaly detection job API (#73908)
Adds a new API that allows a user to reset
an anomaly detection job.

To use the API do:

```
POST _ml/anomaly_detectors/<job_id>_reset
```

The API removes all data associated to the job.
In particular, it deletes model state, results and stats.

However, job notifications and user annotations are not removed.

Also, the API can be called asynchronously by setting the parameter
`wait_for_completion` to `false` (defaults to `true`). When run
that way the API returns the task id for further monitoring.

In order to prevent the job from opening while it is resetting,
a new job field has been added called `blocked`. It is an object
that contains a `reason` and the `task_id`. `reason` can take
a value from ["delete", "reset", "revert"] as all these
operations should block the job from opening. The `task_id` is also
included in order to allow tracking the task if necessary.

Finally, this commit also sets the `blocked` field when
the revert snapshot API is called as a job should not be opened
while it is reverted to a different model snapshot.
2021-06-14 18:56:28 +03:00
Przemyslaw Gomulka 74e3110d73
[Rest Api Compatibility] Typed endpoints for get_source api (#73957)
retrofits typed get_source api removed in #46931 and #46587
relates #51816
2021-06-14 15:28:24 +02:00
Przemyslaw Gomulka 13e884b9b4
[Rest Api Compatibility] Typed endpoints for search _count api (#73958)
retrofits typed endpoints removed in #42112

relates #51816
2021-06-14 15:27:45 +02:00
Przemyslaw Gomulka 30b14f1176
[Rest Api Compatibility] Move won't fix tests from block list (#73912)
block list at the moment contains a lot of tests that we already identified that won't be fixed.
This commit moves them out of the main block list so that it is easier to count progress.
2021-06-14 14:09:49 +02:00
Przemyslaw Gomulka ff8353118f
[Rest Api Compatibility] Typed endpoints for explain api (#73901)
retrofits the typed endpoints for rest explain api removed in #46926

relates #51816
2021-06-09 16:15:57 +02:00
Przemyslaw Gomulka 4598b46e7f
[Rest Api Compatibility] Typed endpoint for multiget api (#73878)
Retrofits typed api for M-get api removed in #46587

relates #51816
2021-06-09 15:19:56 +02:00
Joe Gallo 4bb1f2804e
Re-enable deprecated hot_threads routes via REST compatibility (#73855) 2021-06-08 16:19:19 -04:00
Przemyslaw Gomulka 4bdd00d452
[Rest Api Compatibility] Typed endpoint for bulk api (#73571)
retrofits typed endpoint and type in request parsing
the original types removal commit
#46983

relates #51816
2021-06-07 19:36:31 +02:00
Nik Everett 133a3846ec
Update skip after backport (#73684)
Now that we've backported #73620 we can run the bwc tests against it.
2021-06-03 07:50:36 -04:00
David Kyle 94adaa55c0
[ML] Merge the pytorch-inference feature branch (#73660)
The feature branch contains changes to configure PyTorch models with a 
TrainedModelConfig and defines a format to store the binary models. 
The _start and _stop deployment actions control the model lifecycle 
and the model can be directly evaluated with the _infer endpoint. 
2 Types of NLP tasks are supported: Named Entity Recognition and Fill Mask.

The feature branch consists of these PRs: #73523, #72218, #71679
#71323, #71035, #71177, #70713
2021-06-03 12:43:06 +01:00
Nik Everett 4b5aebe8b0
Add setting to disable aggs optimization (#73620)
Sometimes our fancy "run this agg as a Query" optimizations end up
slower than running the aggregation in the old way. We know that and use
heuristics to dissable the optimization in that case. But it turns out
that the process of running the heuristics itself can be slow, depending
on the query. Worse, changing the heuristics requires an upgrade, which
means waiting. If the heurisics make a terrible choice folks need a
quick way out. This adds such a way: a cluster level setting that
contains a list of queries that are considered "too expensive" to try
and optimize. If the top level query contains any of those queries we'll
disable the "run as Query" optimization.

The default for this settings is wildcard and term-in-set queries, which
is fairly conservative. There are certainly wildcard and term-in-set
queries that the optimization works well with, but there are other queries
of that type that it works very badly with. So we're being careful.

Better, you can modify this setting in a running cluster to disable the
optimization if we find a new type of query that doesn't work well.

Closes #73426
2021-06-02 09:12:54 -04:00
Rene Groeschke b2a183baf0
Move public build api into included build (#72861)
This moves the public build api and plugins into a separete included build called 'build-tools' 
and we removed the duplication of included buildSrc twice (2nd import as build-tools).

The elasticsearch internal build logic is kept in build-tools-internal as included build which allows us better handling of this project that its just being an buildSrc project (e.g. we can reference tasks directly from the root build etc.)

Convention logic applied to both projects will live in a new build-conventions project.
2021-06-01 11:19:30 +02:00
Yang Wang da3d72c724
Add docs and rest api spec for saml complete logout API (#72867)
This PR adds the documentation and Rest API spec file for the SAML complete
logout API. It is a (overdued) follow up for #56316
2021-05-31 11:28:16 +10:00
Julie Tibshirani 67680dbc49 Unmute field collapsing and search_after REST test 2021-05-26 17:16:34 -07:00
David Turner 221c571761
Fix location of repository analyzer API spec (#73378)
The repository analyzer API spec was incorrectly stored in the plugin
directory rather than in the main `rest-api-spec` directory. This commit
fixes that.
2021-05-25 20:23:12 +01:00
David Roberts 6050bd55a4
Muting search/110_field_collapsing/field collapsing and search_after (#73320)
Due to https://github.com/elastic/elasticsearch/issues/73316
2021-05-24 13:21:03 +01:00
Julie Tibshirani b23dfe29d5 Adjust REST tests now that #73023 is backported 2021-05-19 16:24:23 -07:00
Julie Tibshirani f85a9dddb9
Support field collapsing with search_after (#73023)
This change adds support for using `search_after` with field collapsing. When
using these in conjunction, the same field must be used for both sorting and
field collapsing. This helps keep the behavior simple and predictable.
Otherwise it would be possible for a group to appear on multiple pages of
results.

Currently search after is handled directly in `CollapsingTopDocsCollector`. As
a follow-up, we could generalize the logic and move support to the Lucene
grouping framework.

Closes #53115.
2021-05-19 14:21:18 -07:00
István Zoltán Szabó a6830edac8
Fixes URL in security enroll node API json. (#73228) 2021-05-19 14:34:11 +02:00
Przemyslaw Gomulka 35460a5f8a
[Rest Api Compatibility] REST Terms vector typed response (#73117)
Enabling the tests and adds a type field for termvector response
the commit that enabled typed endpoints but missed to update the response
#72155
2021-05-19 13:23:47 +02:00
Przemyslaw Gomulka d5bf72ab13
[Rest Api Compatibility] Typed endpoints for RestUpdateAction and RestDeleteAction (#73115)
the previously removed typed enpotins for Update and Delete are
retrofitted in this commit
the commit that removed them
https://github.com/elastic/elasticsearch/pull/47671

relates main meta issue #51816
relates types removal issue #54160
2021-05-18 13:07:13 +02:00
Seth Michael Larson ff406a88cc
Rename 'termsenum' API to 'terms_enum' for better readability 2021-05-17 08:08:06 -05:00
Przemyslaw Gomulka 85ed9100df
[Rest Api Compatibility] Typed endpoints for search and related endpoints (#72155)
Implements a V7 compatible typed endpoints for REST for search related apis
retrofits the REST layer change removed in #41640

relates main meta issue #51816
relates types removal issue #54160
2021-05-12 21:00:19 +02:00
James Rodewig 7909d3bd77
[DOCS] Fix JSON spec link for terms enum API (#72996) 2021-05-12 12:57:56 -04:00
Ioannis Kakavas b826703e21
Enroll node API (#72129)
Enroll node API can be used by new nodes in order to join an
existing cluster that has security features enabled. The response
of a call to this API contains all the necessary information that
the new node requires in order to configure itself and bootstrap
trust with the existing cluster.
2021-05-12 08:45:02 +03:00
Nik Everett db80a50b74
Update skip after backport (#72921)
Now that #72727 has landed in 7.x we can run the bwc tests against its
changes.
2021-05-11 09:12:51 -04:00
Nik Everett a43b166d11
More debugging info for significant_text (#72727)
Adds some extra debugging information to make it clear that you are
running `significant_text`. Also adds some using timing information
around the `_source` fetch and the `terms` accumulation. This lets you
calculate a third useful timing number: the analysis time. It is
`collect_ns - fetch_ns - accumulation_ns`.

This also adds a half dozen extra REST tests to get a *fairly*
comprehensive set of the operations this supports. It doesn't cover all
of the significance heuristic parsing, but its certainly much better
than what we had.
2021-05-10 12:50:46 -04:00
Przemyslaw Gomulka 668a72dec5
[Rest API Compatibility] Typed endpoints for Put and Get Mapping and get field mappings (#71721)
Implements a V7 compatible typed endpoints for REST put and get mapping endpoints. Also for Get Field Mappings endpoints.
retrofits the REST layer change removed in #41676

relates main meta issue #51816
relates types removal issue #54160
2021-05-10 10:25:48 +02:00
markharwood 73e0662f09
New TermsEnum API for discovering terms in the index. (#66452)
New api designed for use by apps like Kibana for auto-complete use cases.
A search string is supplied which is used as prefix for matching terms found in a given field in the index.
Supported field types are keyword, constant_keyword and flattened.
A timeout can limit the amount of time spent looking for matches (default 1s) and an `index_filter` query can limit indices e.g. those in the hot or warm tier by querying the `_tier` field

Closes #59137
2021-05-06 10:45:37 +01:00
Przemyslaw Gomulka e0799c82d8
[Rest Api Compatibility] transformations for keys in match and length (#72156) 2021-05-04 09:56:37 -04:00
Joe Gallo 3fd49d81b7
Adjust yamlRestCompatTest to account for some tests that are passing (#72437) 2021-04-29 09:38:22 -04:00
Christos Soulios 99e2cf08a0
Add REST tests for histogram aggregation (#72322)
Related to #26220
2021-04-28 17:54:43 +03:00
Nik Everett b31dba558d
Update skip after backport (#72381)
Now that #72081 has landed in the 7.x branch we can run its test in the
backwards compatibility test suite.
2021-04-28 09:15:06 -04:00
Nik Everett 5f281ceedd
Prevent `date_histogram` from OOMing (#72081)
This prevents the `date_histogram` from running out of memory allocating
empty buckets when you set the interval to something tiny like `seconds`
and aggregate over a very wide date range. Without this change we'd
allocate memory very quickly and throw and out of memory error, taking
down the node. With it we instead throw the standard "too many buckets"
error.

Relates to #71758
2021-04-27 14:41:52 -04:00
Julie Tibshirani fdf254335f
Remove more references to query_and_fetch. (#71988)
This search type was deleted several releases ago.
2021-04-23 09:19:57 -07:00
Christoph Büscher a84a237f05
Fix fetch_fields yaml test result order (#71691)
The test failing in #71685 does so because under rare circumstance the result
order for match_all can be different. If we want to make assertions on specific
entries in the result, we should sort by a field that imposes a fixed result
ordering.

Closes #71685
2021-04-23 10:30:33 +02:00
Nik Everett 39fee5e908
Fix composite early termination on sorted (#72101)
I broke composite early termination when reworking how aggregations'
contact for `getLeafCollector` around early termination in #70320. We
didn't see it in our tests because we weren't properly emulating the
aggregation collection stage. This fixes early termination by adhering
to the new contract and adds more tests.

Closes #72078

Co-authored-by: Benjamin Trent <4357155+benwtrent@users.noreply.github.com>
2021-04-22 14:32:26 -04:00
Mark Tozzi 05a68e0b57
Fix skip version on composite filter now that it's backported (#71878) 2021-04-22 11:41:22 -04:00
Nik Everett f88fd37df4
Update skip after backport of #71758 (#72047)
Now that #71758 has landed in 7.x we don't have to skip its tests when
running backwards compatibility tests.
2021-04-21 17:51:15 -04:00
Tomas Della Vedova b4739e153e
Fix monitoring.bulk spec content_type (#71629) 2021-04-21 09:03:25 -04:00
Yang Wang 150b6ad37a
Service Accounts - add rest specs and tests (#71888)
This PR adds rest specs and associated tests for APIs of the service accounts feature.
2021-04-21 14:29:14 +10:00
Nik Everett cf8d56a6e5
Prevent histogram from allocating tons of buckets (#71758)
This prevents the `histogram` aggregation from allocating tons of empty
buckets when you set the `interval` to something tiny. Instead, we
reject the request. We're not in a place where we can aggregate over
huge ranges with tiny intervals, but we should fail gracefully when you
ask us to do so rather than OOM.

Closes #71744
2021-04-20 18:10:59 -04:00
Tim Brooks bfb85bcecb
Wait on index when polling global checkpoints (#71890)
Currently when the fleet global checkpoints API returns immediately if
the index is not ready or shards are not ready. This commit modifies the
API to wait on the index and primary shards active up until the timeout
period.

Related to #71449.
2021-04-20 13:04:42 -06:00
Tanguy Leroux f50b35719e
Revive documentation for experimental Searchable Snapshots APIs (#71927)
This commit revives the documentation of the "Clear Cache" and 
"Shard Stats" APIs of Searchable Snapshots that was removed 
in #62217. This is a partial revert of the commit b545c55 with 
some light wording changes.

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
2021-04-20 18:34:48 +02:00
David Turner 83c64ded2d
Adjust BWC for tracking snapshot index details (#71913)
Re-enables BWC tests and completes the backport of #71754
2021-04-20 13:16:14 +01:00
Mark Tozzi 7b29cb31b4
Allow composite to be a sub-aggregation of filter (#71639) 2021-04-19 13:28:03 -04:00
Tanguy Leroux ceaa16eddc
Add node level cache stats for searchable snapshots (#71701)
This commit adds node-level statistics about the searchable 
snapshots shared cache that can be retrieved using the REST 
endpoint `GET /_searchable_snapshots/cache/stats`.

And the returned informations are:
{
  "nodes" : {
    "eerrtBMtQEisohZzxBLUSw" : {
      "shared_cache" : {
        "reads" : 6051,
        "bytes_read" : "5.1mb",
        "bytes_read_in_bytes" : 5448829,
        "writes" : 37,
        "bytes_written" : "1.1mb",
        "bytes_written_in_bytes" : 1208320,
        "evictions" : 5,
        "num_regions" : 32,
        "size" : "1mb",
        "size_in_bytes" : 1048576,
        "region_size" : "32kb",
        "region_size_in_bytes" : 32768
      }
    }
  }
}
2021-04-19 17:02:27 +02:00
David Turner c8fb9aad40
Track index details in SnapshotInfo (#71754)
This commit adds some per-index statistics to the `SnapshotInfo` blob:

- number of shards
- total size in bytes
- maximum number of segments per shard

It also exposes these statistics in the get snapshot API.
2021-04-19 14:57:32 +01:00
Dimitris Athanasiou b5a8ffd7ca
[ML] Mark data frame analytics API specs as GA (#71818) 2021-04-19 16:29:08 +03:00
Przemyslaw Gomulka 3ef5e4c6e7
[Rest Compatible Api] include_type_name parameter (#70966)
This commit allows to use the include_type_name parameter with the compatible rest api.
The support for include_type_name was previously removed in #48632

relates #51816
types removal meta issue #54160
2021-04-19 15:21:24 +02:00
Rick Boyd 53b0141a11
Fix cluster.get_settings documentation URL 2021-04-16 10:56:12 -05:00
Igor Motov 02eef40a45
Tests: add support for close_to assertion (#71590)
Adds support for close_to assertion to yaml tests. The assertion can be called
the following way:
```
  - close_to:   { get.fields._routing: { value: 5.1, error: 0.00001 } }
```
Closes #71303
2021-04-15 17:11:37 -10:00
Christoph Büscher 5e481b4b36 [Test] Adapt skip version after backport 2021-04-15 15:51:50 +02:00
Christoph Büscher 708947b4bd Skip flattend subfields rest test 2021-04-15 14:57:39 +02:00
Tanguy Leroux d1c3b71384
Reenable BWC tests after backport of #71725 (#71732)
This commit reenables BWC tests (disabled in #71728) and adjusts some versions.
2021-04-15 13:38:40 +02:00
Christoph Büscher 948d02e4d6
Support fetching flattened subfields (#70916)
Currently the `fields` API fetches the root flattened field and returns it in a
structured way in the response. In addition this change makes it possible to
directly query subfields. However, requesting flattened subfields via wildcard
patterns is not possible.

Closes #70605
2021-04-15 12:28:58 +02:00
Tanguy Leroux fe4c3e745c
Enhanced segment files sizes information in Nodes Stats/Indices Stats APIs (#71643)
Since #16661 it is possible to know the total sizes for some Lucene segment files 
by using the Node Stats or Indices Stats API with the include_segment_file_sizes 
parameter, and the list of file extensions has been extended in #71416.

This commit adds a bit more information about file sizes like the number of files 
(count), the min, max and average file sizes in bytes that share the same extension.

Here is a sample:
"cfs" : {
  "description" : "Compound Files",
  "size_in_bytes" : 2260,
  "min_size_in_bytes" : 2260,
  "max_size_in_bytes" : 2260,
  "average_size_in_bytes" : 2260,
  "count" : 1
}

This commit also simplifies how compound file sizes were computed: before 
compound segment files were extracted and sizes aggregated with regular 
non-compound files sizes (which can be confusing and out of the scope of 
the original issue #6728), now CFS/CFE files appears as distinct files.

These new information are provided to give a better view of the segment 
files and are useful in many cases, specially with frozen searchable snapshots 
whose segment stats can now be introspected thanks to the 
include_unloaded_segments parameter.
2021-04-15 10:15:26 +02:00
Julie Tibshirani 2318be0be2 Adjust skip versions for combined_fields tests.
We can run the REST tests against 7.13 now that it's been backported.
2021-04-14 16:06:20 -07:00
Nik Everett 2d6f8d1e0c
Add integration tests for filters (#69439)
Revamps the integration tests for the `filter` agg to be more clear and
builds integration tests for the `fitlers` agg. Both of these
integration tests are fairly basic but they do assert that the aggs
work.
2021-04-14 16:54:23 -04:00
Julie Tibshirani 318bf14126
Introduce `combined_fields` query (#71213)
This PR introduces a new query called `combined_fields` for searching multiple
text fields. It takes a term-centric view, first analyzing the query string
into individual terms, then searching for each term any of the fields as though
they were one combined field. It is based on Lucene's `CombinedFieldQuery`,
which takes a principled approach to scoring based on the BM25F formula.

This query provides an alternative to the `cross_fields` `multi_match` mode. It
has simpler behavior and a more robust approach to scoring.

Addresses #41106.
2021-04-14 13:33:19 -07:00
Tim Brooks d5b96a35d0
Add fleet polling API for global checkpoint (#71093)
Fleet server needs an API to access up to date global checkpoints for
indices. Additionally, it requires a mode of operation when fleet can
provide its current knowledge about the global checkpoints and poll for
advancements. This commit introduces this API in the fleet plugin.
2021-04-14 11:19:33 -06:00
Nik Everett b4bac7b769
Test: assert adjacency matrix cache (#69440)
Adds an assertion that the adjacency matrix aggregation can hit the
request cache even when the request contains a lookup style `terms`
filter.
2021-04-13 16:57:26 -04:00
Nik Everett 57e6c78a52
Fix profiled global agg (#71575)
This fixes the `global` aggregator when `profile` is enabled. It does so
by removing all of the special case handling for `global` aggs in
`AggregationPhase` and having the global aggregator itself perform the
scoped collection using the same trick that we use in filter-by-filter
mode of the `filters` aggregation.

Closes #71098
2021-04-13 08:36:51 -04:00
Mark Tozzi 3c198e2606
Tests for running composite under nested aggregation (#68243) 2021-04-12 10:52:01 -04:00
Nhat Nguyen 8bef36dac7
Adjust BWC version for dynamic templates in bulk requests (#71537)
Relates #69948
2021-04-10 16:01:31 -04:00