-
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.
- Loading branch information
Showing
4 changed files
with
73 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
62 changes: 62 additions & 0 deletions
62
rest-api-spec/src/main/resources/rest-api-spec/test/index/110_constant_keyword.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,62 @@ | ||
--- | ||
setup: | ||
- do: | ||
indices.create: | ||
index: test | ||
body: | ||
mappings: | ||
properties: | ||
genre: | ||
type : "constant_keyword" | ||
"value" : "Romantic comedy" | ||
|
||
- do: | ||
index: | ||
index: test | ||
id: 1 | ||
body: { | ||
"genre": "Romantic comedy", | ||
"name": "name1" | ||
} | ||
|
||
- do: | ||
indices.refresh: | ||
index: test | ||
|
||
--- | ||
# Delete Index when connection is teardown | ||
teardown: | ||
- do: | ||
indices.delete: | ||
index: test | ||
|
||
--- | ||
"Mappings": | ||
- skip: | ||
version: " - 2.13.99" | ||
reason: "constant_keyword is introduced in 2.14.0" | ||
|
||
- do: | ||
indices.get_mapping: | ||
index: test | ||
- is_true: test.mappings | ||
- match: { test.mappings.properties.genre.type: constant_keyword } | ||
- length: { test.mappings.properties.genre: 2 } | ||
|
||
--- | ||
"Supported queries": | ||
- skip: | ||
version: " - 2.13.99" | ||
reason: "constant_keyword is introduced in 2.14.0 in main branch" | ||
|
||
# Verify Document Count | ||
- do: | ||
search: | ||
body: { | ||
query: { | ||
match_all: {} | ||
} | ||
} | ||
|
||
- length: { hits.hits: 1 } | ||
- match: { hits.hits.0._source.genre: "Romantic comedy" } |
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