-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable synthetic source support on constant keyword fields (#88603)
This commit implements synthetic source support on constant keyword fields, which will now always emit their value as part of the retrieved source.
- Loading branch information
1 parent
0d7e4c2
commit 2f5ec51
Showing
5 changed files
with
101 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 88603 | ||
summary: Enable synthetic source support on constant keyword fields | ||
area: Mapping | ||
type: enhancement | ||
issues: [] |
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
38 changes: 38 additions & 0 deletions
38
...er-constant-keyword/src/yamlRestTest/resources/rest-api-spec/test/20_synthetic_source.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 @@ | ||
constant_keyword: | ||
- skip: | ||
version: " - 8.3.99" | ||
reason: introduced in 8.4.0 | ||
|
||
- do: | ||
indices.create: | ||
index: test | ||
body: | ||
mappings: | ||
_source: | ||
mode: synthetic | ||
properties: | ||
const_kwd: | ||
type: constant_keyword | ||
value: bar | ||
kwd: | ||
type: keyword | ||
|
||
- do: | ||
index: | ||
index: test | ||
id: 1 | ||
refresh: true | ||
body: | ||
kwd: foo | ||
|
||
- do: | ||
search: | ||
index: test | ||
body: | ||
query: | ||
ids: | ||
values: [1] | ||
- match: | ||
hits.hits.0._source: | ||
kwd: foo | ||
const_kwd: bar |