-
Notifications
You must be signed in to change notification settings - Fork 62
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 <[email protected]>
- Loading branch information
1 parent
3f806a1
commit e60e61b
Showing
5 changed files
with
349 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,171 @@ | ||
$schema: ../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Comprehensive test for TermsQuery, covering term lookup, boost, and array of terms, including nested fields. | ||
version: '>= 1.2' | ||
|
||
prologues: | ||
- path: /directors | ||
method: PUT | ||
request: | ||
payload: | ||
mappings: | ||
properties: | ||
name: | ||
type: text | ||
favorite_genre: | ||
type: keyword | ||
status: [200] | ||
|
||
- path: /directors/_doc/1 | ||
method: POST | ||
request: | ||
payload: | ||
name: John Doe | ||
favorite_genre: Animation | ||
status: [201] | ||
|
||
- 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: Beauty and the Beast | ||
genre: Animation | ||
director_id: '1' | ||
status: [201] | ||
|
||
- path: /movies/_doc | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
payload: | ||
title: The Lion King | ||
genre: Animation | ||
director_id: '1' | ||
status: [201] | ||
|
||
- path: /classes | ||
method: PUT | ||
request: | ||
payload: | ||
mappings: | ||
properties: | ||
name: | ||
type: text | ||
enrolled_students: | ||
properties: | ||
id_list: | ||
type: keyword | ||
status: [200] | ||
|
||
- path: /classes/_doc/102 | ||
method: POST | ||
request: | ||
payload: | ||
name: CS102 | ||
enrolled_students: | ||
id_list: | ||
- '111' | ||
- '333' | ||
status: [201] | ||
|
||
- path: /students | ||
method: PUT | ||
request: | ||
payload: | ||
mappings: | ||
properties: | ||
name: | ||
type: text | ||
student_id: | ||
type: keyword | ||
status: [200] | ||
|
||
- path: /students/_doc/1 | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
payload: | ||
name: Jane Doe | ||
student_id: '111' | ||
status: [201] | ||
|
||
- path: /students/_doc/3 | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
payload: | ||
name: John Doe | ||
student_id: '333' | ||
status: [201] | ||
|
||
epilogues: | ||
- path: /movies | ||
method: DELETE | ||
status: [200, 404] | ||
|
||
- path: /directors | ||
method: DELETE | ||
status: [200, 404] | ||
|
||
- path: /classes | ||
method: DELETE | ||
status: [200, 404] | ||
|
||
- path: /students | ||
method: DELETE | ||
status: [200, 404] | ||
|
||
chapters: | ||
- synopsis: Search using TermsQuery with an object for term lookup in nested fields. | ||
path: /{index}/_search | ||
parameters: | ||
index: students | ||
method: GET | ||
request: | ||
payload: | ||
query: | ||
terms: | ||
student_id: | ||
index: classes | ||
id: '102' | ||
path: enrolled_students.id_list | ||
response: | ||
status: 200 | ||
payload: | ||
timed_out: false | ||
hits: | ||
total: | ||
value: 2 | ||
relation: eq | ||
hits: | ||
- _index: students | ||
_id: '1' | ||
_score: 1 | ||
_source: | ||
name: Jane Doe | ||
student_id: '111' | ||
- _index: students | ||
_id: '3' | ||
_score: 1 | ||
_source: | ||
name: John Doe | ||
student_id: '333' |
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,67 @@ | ||
$schema: ../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test TermsQuery with an array of terms. | ||
version: '>= 1.2' | ||
prologues: | ||
- path: /movies | ||
method: PUT | ||
request: | ||
payload: | ||
mappings: | ||
properties: | ||
title: | ||
type: text | ||
genre: | ||
type: keyword | ||
- 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] | ||
epilogues: | ||
- path: /movies | ||
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 |
Oops, something went wrong.