-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding new
require_alias
option to indexing requests (#58917)
This commit adds the `require_alias` flag to requests that create new documents. This flag, when `true` prevents the request from automatically creating an index. Instead, the destination of the request MUST be an alias. When the flag is not set, or `false`, the behavior defaults to the `action.auto_create_index` settings. This is useful when an alias is required instead of a concrete index. closes #55267
- Loading branch information
Showing
30 changed files
with
447 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
rest-api-spec/src/main/resources/rest-api-spec/test/index/70_require_alias.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
"Set require_alias flag": | ||
- skip: | ||
# TODO adjust after backport | ||
version: " - 7.99.99" | ||
reason: "require_alias flag added in 7.9+" | ||
- do: | ||
catch: missing | ||
index: | ||
index: test_require_alias | ||
require_alias: true | ||
body: { foo: bar } | ||
- do: | ||
catch: missing | ||
indices.get: | ||
index: test_require_alias | ||
|
||
- do: | ||
indices.create: | ||
index: backing_index | ||
body: | ||
mappings: {} | ||
aliases: | ||
test_require_alias: {} | ||
|
||
- do: | ||
index: | ||
index: test_require_alias | ||
require_alias: true | ||
body: { foo: bar } |
36 changes: 36 additions & 0 deletions
36
rest-api-spec/src/main/resources/rest-api-spec/test/update/95_require_alias.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
"Set require_alias flag": | ||
- skip: | ||
# TODO adjust after backport | ||
version: " - 7.99.99" | ||
reason: "require_alias flag added in 7.9+" | ||
- do: | ||
catch: missing | ||
update: | ||
index: test_require_alias | ||
id: 1 | ||
require_alias: true | ||
body: | ||
doc: { foo: bar, count: 1 } | ||
doc_as_upsert: true | ||
- do: | ||
catch: missing | ||
indices.get: | ||
index: test_require_alias | ||
|
||
- do: | ||
indices.create: | ||
index: backing_index | ||
body: | ||
mappings: {} | ||
aliases: | ||
test_require_alias: {} | ||
|
||
- do: | ||
update: | ||
index: test_require_alias | ||
id: 1 | ||
require_alias: true | ||
body: | ||
doc: { foo: bar, count: 1 } | ||
doc_as_upsert: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.