-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
- Loading branch information
1 parent
30f1846
commit 147e77e
Showing
4 changed files
with
233 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
$schema: ../../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Comprehensive test suite for TermsQuery, including array of terms and term lookup. | ||
version: '>= 1.2' | ||
|
||
prologues: | ||
- path: /movies | ||
method: PUT | ||
request: | ||
payload: | ||
mappings: | ||
properties: | ||
title: | ||
type: text | ||
genre: | ||
type: keyword | ||
director_id: | ||
type: keyword | ||
status: [200] | ||
|
||
- path: /movies/_doc | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
payload: | ||
title: The Lion King | ||
genre: animation | ||
status: [201] | ||
|
||
- path: /movies/_doc | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
payload: | ||
title: Beauty and the Beast | ||
genre: adventure | ||
status: [201] | ||
|
||
- path: /games | ||
method: PUT | ||
request: | ||
payload: | ||
mappings: | ||
properties: | ||
title: | ||
type: text | ||
genre: | ||
type: keyword | ||
developer_id: | ||
type: keyword | ||
status: [200] | ||
|
||
- path: /games/_doc | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
payload: | ||
title: Monopoly | ||
genre: RPG | ||
status: [201] | ||
|
||
- path: /games/_doc | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
payload: | ||
title: Cyberpunk 2077 | ||
genre: RPG | ||
status: [201] | ||
|
||
epilogues: | ||
- path: /movies | ||
method: DELETE | ||
status: [200, 404] | ||
|
||
- path: /games | ||
method: DELETE | ||
status: [200, 404] | ||
|
||
chapters: | ||
- synopsis: Search using TermsQuery with an array of terms. | ||
path: /{index}/_search | ||
parameters: | ||
index: movies | ||
method: GET | ||
request: | ||
payload: | ||
query: | ||
terms: | ||
genre: | ||
- adventure | ||
- animation | ||
response: | ||
status: 200 | ||
payload: | ||
timed_out: false | ||
hits: | ||
total: | ||
value: 2 | ||
relation: eq | ||
hits: | ||
- _index: movies | ||
_score: 1 | ||
_source: | ||
title: The Lion King | ||
genre: animation | ||
- _index: movies | ||
_score: 1 | ||
_source: | ||
title: Beauty and the Beast | ||
genre: adventure | ||
|
||
- synopsis: Search using TermsQuery with an array of terms in the games index. | ||
path: /{index}/_search | ||
parameters: | ||
index: games | ||
method: GET | ||
request: | ||
payload: | ||
query: | ||
terms: | ||
genre: | ||
- RPG | ||
response: | ||
status: 200 | ||
payload: | ||
timed_out: false | ||
hits: | ||
total: | ||
value: 2 | ||
relation: eq | ||
hits: | ||
- _index: games | ||
_score: 1 | ||
_source: | ||
title: Monopoly | ||
genre: RPG | ||
- _index: games | ||
_score: 1 | ||
_source: | ||
title: Cyberpunk 2077 | ||
genre: RPG |
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,66 @@ | ||
$schema: ../../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test TermsSetQuery functionality with complex example using movies. | ||
version: '>= 1.2' | ||
|
||
prologues: | ||
- path: /movies | ||
method: PUT | ||
request: | ||
payload: | ||
mappings: | ||
properties: | ||
title: | ||
type: keyword | ||
genres: | ||
type: keyword | ||
min_required_genres: | ||
type: integer | ||
|
||
- path: /movies/_doc/1 | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
payload: | ||
title: The Lion King | ||
genres: [Adventure, Animation, Family] | ||
min_required_genres: 2 | ||
status: [201] | ||
|
||
- path: /movies/_doc/2 | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
payload: | ||
title: Beauty and the Beast | ||
genres: [Animation, Family, Musical] | ||
min_required_genres: 2 | ||
status: [201] | ||
|
||
epilogues: | ||
- path: /movies | ||
method: DELETE | ||
status: [200, 404] | ||
|
||
chapters: | ||
- synopsis: Search using TermsSetQuery with terms array and minimum_should_match_field. | ||
path: /{index}/_search | ||
parameters: | ||
index: movies | ||
method: POST | ||
request: | ||
payload: | ||
query: | ||
terms_set: | ||
genres: | ||
terms: [Adventure, Animation, Family] | ||
minimum_should_match_field: min_required_genres | ||
response: | ||
status: 200 | ||
payload: | ||
timed_out: false | ||
hits: | ||
total: | ||
value: 2 |