-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…#59769) * 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
36 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
29 changes: 29 additions & 0 deletions
29
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,29 @@ | ||
--- | ||
"Set require_alias flag": | ||
- skip: | ||
version: " - 7.9.99" | ||
reason: "require_alias flag added in 7.10" | ||
- 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 } |
35 changes: 35 additions & 0 deletions
35
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,35 @@ | ||
--- | ||
"Set require_alias flag": | ||
- skip: | ||
version: " - 7.9.99" | ||
reason: "require_alias flag added in 7.10" | ||
- 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.