Commit Graph

71 Commits

Author SHA1 Message Date
Przemyslaw Gomulka c96139d006
[Rest Api Compatibility] Deprecate the use of synced flush (#75372)
synced flush is going to be replaced by flush. This commit allows to synced_flush api only in v7 compatibility mode.
Worth noting - sync_id is gone and won't be available in v7 responses from indices.stats

relates removal pr #50882
relates #51816
2021-07-28 14:17:49 +02:00
Przemyslaw Gomulka 838e8d8aeb
[Rest Api Compatibility] Voting config exclusion exception message (#75406)
the exception message has changed in #55291. This is not covered by rest
api compatibility, so no need to return the old message for v7 requests.
This commit adds a transformation to allow for the 7.x test to pass with
a new exception message

relates #51816
2021-07-26 16:42:38 +02:00
Przemyslaw Gomulka 5485d3ebdd
[Rest Api Compatibility] Do not return _doc for empty mappings in template (#75448)
Previously the compatibility layer was always returning an _doc in mappings for get
template.
This commit does not return _doc in empty mappings.
Returning just {} empty object (v7 and v8 behaviour)

also moving term lookups tests which are already fixed (relates #74544)

relates #70966
relates main meta issue #51816
relates types removal meta #54160
2021-07-19 13:21:00 +02:00
Przemyslaw Gomulka 4af7150a40
[Rest Api Compatibility] Allow to use size -1 (#75342)
previously disallowed in #70209. However since now the recommendation is
to not set the field at all - and rely on a default - this would be a
shape change for users prefering to set -1 so far.
With request compatible with v7 they will still be allowed to do this
and will get a warning.

relates #69548
relates #51816
2021-07-16 12:46:05 +02:00
Przemyslaw Gomulka 2320a38833
[Rest Api Compatibility] Allow transforming warnings per test (#75187)
Warning related transformations missed the possibility to apply per single test only.
Also a warning changed in #67158 for indices.close so this PR also applies the transformation for 7.x test

relates #51816
2021-07-15 10:50:42 +02:00
Przemyslaw Gomulka 71e05838a6
[Rest Api Compatibility] Enable tests after types and cat api fixed (#75179)
Some tests are fixed after typed api is available with compatible api.
Also cat api returning text fixed some tests
relates #51816
2021-07-14 08:37:38 +02:00
Przemyslaw Gomulka ff8aede63a
[Rest Api Compatibility] MoreLikeThisQuery with types (#75123)
previously removed in #42198
also adding a type for MultiTermVectorsResponse in failures

relates #54160
relates #51816
2021-07-12 12:08:45 +02: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Jason Tedor 8d716e83fd
Re-enable BWC tests after migrating ML roles
This commit reenables the BWC tests after the ML roles were migrated to
server. During the course of that work, the BWC tests were disabled
pending that work being backported to 7.x. Now that that work is not
going to be backported to 7.x, instead we apply some permanent
transformations to the 7.x assertions run against ES in the REST
compatibility tests.
2021-04-07 19:40:53 -04:00
Jake Landis 26ed10b4df
fix REST compat test with test transform 2021-03-31 16:12:50 -05:00
Mark Vieira 6339691fe3
Consolidate REST API specifications and publish under Apache 2.0 license (#70036) 2021-03-26 16:20:14 -07:00
Przemyslaw Gomulka e942873bd5
[REST Compatible API] Typed endpoints for Index and Get APIs (#69131)
The types removal effort has removed the type from Index API in #47671 and from Get API in #46587
This commit allows to use 'typed' endpoints for the both Index and Get APIs

relates compatible types-removal meta issue #54160
2021-03-23 10:59:21 +01:00
Christoph Büscher c3a8674f7c
Completely disallow setting negative size in search (#70209)
We used to treat setting size to -1 in search request bodies or as a rest
parameter as a no-op, using the default search size of 10 in this case. This
lenient behaviour was deprecated in #69548 and is removed with this PR in 8.0.

Relates to #69548
2021-03-11 11:42:25 +01:00
Gordon Brown 7c347406ed
Remove old test from REST compatibility blocklist (#70187)
This test was left on the blacklist, but no longer exists under this
name, as the API name was changed. This commit removes it from the list.
2021-03-09 17:12:15 -07:00
Nik Everett f3680b49f2
Update skip after backport of #69806 (#70153)
Now that we've backported #69806 we can test it in the bwc tests.
2021-03-09 10:51:27 -05:00
Przemyslaw Gomulka 9ad9c781de
Add compatible logging when parsing a compatible field (#69539)
A #68808 introduced a possibility to declare fields which will be only available to parsing when a compatible API was used.

This commit replaces deprecated log with compatible logging when a 'compatible only' field was used. Also includes a refactoring of LoggingDeprecationHandler method names

relates #51816
2021-03-09 12:29:40 +01:00
Przemyslaw Gomulka 3114436329
Ignore a testcase until a compatible api is implemented (#70095)
'search/110_field_collapsing/field collapsing and inner_hits', is
enabled in 7.x (#69753 )and the compatible api is not implemented yet
2021-03-08 18:39:55 +01:00
Nik Everett 10e2f90560
Speed up aggs with sub-aggregations (#69806)
This allows many of the optimizations added in #63643 and #68871 to run
on aggregations with sub-aggregations. This should:
* Speed up `terms` aggregations on fields with less than 1000 values that
  also have sub-aggregations. Locally I see 2 second searches run in 1.2
  seconds.
* Applies that same speedup to `range` and `date_histogram` aggregations but
  it feels less impressive because the point range queries are a little
  slower to get up and go.
* Massively speed up `filters` aggregations with sub-aggregations that
  don't have a `parent` aggregation or collect "other" buckets. Also
  save a ton of memory while collecting them.
2021-03-03 18:04:47 -05:00
Gordon Brown ce8a0c0cea
Change Get Snapshottable Features endpoint to `_features` (#69755)
The endpoint `_snapshottable_features` is long and implies incorrect
things about this API - it is used not just for snapshots, but also for
the upcoming reset API. Following discussions on the team, this commit
changes the endpoint to `_features` and removes the connection between
this API and snapshots, as snapshots are not the only use for the output
of this API.
2021-03-02 11:30:02 -07:00
Nik Everett 8b8a20ba18
Update skip after backport (#69710)
Now that we've backported #69377 to 7.x we can run backwards
compatibility tests against it.
2021-03-01 11:43:44 -05:00
Nik Everett 19eef6a258 Skip test before backport
Skip running the a particular filters aggregator test while we backport
the change that'll make it correct.
2021-02-25 14:50:08 -05:00
Mark Vieira 30eca91183 Mute rest-api-spec compatibility tests on Windows 2021-02-24 12:34:51 -08:00