-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport 2.x] Fix array_index_out_of_bounds_exception when indexing …
…documents with field name containing only dot (#15188) * Fix array_index_out_of_bounds_exception when indexing documents with field name containing only dot (#15126) * Fix array_index_out_of_bounds_exception when indexing documents with field name containing only dot Signed-off-by: Gao Binlong <gbinlong@amazon.com> * Modify change log Signed-off-by: Gao Binlong <gbinlong@amazon.com> * Optimize error message Signed-off-by: Gao Binlong <gbinlong@amazon.com> --------- Signed-off-by: Gao Binlong <gbinlong@amazon.com> (cherry picked from commit 252742b) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update 120_field_name.yml Signed-off-by: Andriy Redko <andriy.redko@aiven.io> --------- Signed-off-by: Gao Binlong <gbinlong@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Andriy Redko <andriy.redko@aiven.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Andriy Redko <andriy.redko@aiven.io>
- Loading branch information
1 parent
fef2003
commit 76f3b0a
Showing
4 changed files
with
74 additions
and
0 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
38 changes: 38 additions & 0 deletions
38
rest-api-spec/src/main/resources/rest-api-spec/test/index/120_field_name.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,38 @@ | ||
--- | ||
"Index documents with field name containing only dot fail with an IllegalArgumentException": | ||
- skip: | ||
version: " - 2.16.99" | ||
reason: "introduced in 2.17.0" | ||
|
||
- do: | ||
indices.create: | ||
index: test_1 | ||
|
||
- do: | ||
catch: /field name cannot contain only the character \[.\]/ | ||
index: | ||
index: test_1 | ||
id: 1 | ||
body: { | ||
.: bar | ||
} | ||
|
||
- do: | ||
catch: /field name cannot contain only the character \[.\]/ | ||
index: | ||
index: test_1 | ||
id: 1 | ||
body: { | ||
..: bar | ||
} | ||
|
||
- do: | ||
catch: /field name cannot contain only the character \[.\]/ | ||
index: | ||
index: test_1 | ||
id: 1 | ||
body: { | ||
foo: { | ||
.: bar | ||
} | ||
} |
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