-
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.
Add missing Index API Spec Tests, Part 1 (#678)
- Loading branch information
Showing
6 changed files
with
150 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
$schema: ../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test specific field mappings endpoints. | ||
prologues: | ||
- path: /{index} | ||
method: PUT | ||
parameters: | ||
index: movies | ||
request: | ||
payload: | ||
mappings: | ||
properties: | ||
director: | ||
type: text | ||
year: | ||
type: integer | ||
location: | ||
type: ip | ||
ignore_malformed: true | ||
epilogues: | ||
- path: /movies | ||
method: DELETE | ||
status: [200, 404] | ||
chapters: | ||
- synopsis: Add new fields to index mapping. | ||
path: /{index}/_mapping | ||
method: POST | ||
parameters: | ||
index: movies | ||
request: | ||
payload: | ||
properties: | ||
genre: | ||
type: text | ||
rating: | ||
type: float | ||
response: | ||
status: 200 | ||
payload: | ||
acknowledged: true | ||
- synopsis: Get specific field mappings for an index. | ||
path: /{index}/_mapping/field/{fields} | ||
method: GET | ||
parameters: | ||
index: movies | ||
fields: director,year | ||
response: | ||
status: 200 | ||
payload: | ||
movies: | ||
mappings: | ||
year: | ||
full_name: year | ||
mapping: | ||
year: | ||
type: integer | ||
director: | ||
full_name: director | ||
mapping: | ||
director: | ||
type: text |
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,36 @@ | ||
$schema: ../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test endpoints relevant to the lifecycle of an index, including multi-get and multi-search operations. | ||
prologues: | ||
- path: /_bulk | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
content_type: application/x-ndjson | ||
payload: | ||
- {create: {_index: books, _id: book1}} | ||
- {author: Harper Lee, title: To Kill a Mockingbird, year: 60} | ||
- {create: {_index: books, _id: book2}} | ||
- {director: Bennett Miller, title: The Cruise, year: 1998} | ||
- {create: {_index: books, _id: book3}} | ||
- {director: Nicolas Winding Refn, title: Drive, year: 1960} | ||
epilogues: | ||
- path: /books | ||
method: DELETE | ||
status: [200, 404] | ||
chapters: | ||
- synopsis: Perform a `_msearch` request to execute multiple search queries in a single call. | ||
path: /{index}/_msearch | ||
method: POST | ||
parameters: | ||
index: books | ||
request: | ||
content_type: application/x-ndjson | ||
payload: | ||
- {index: books} | ||
- {query: {match: {title: To Kill a Mockingbird}}} | ||
- {index: books} | ||
- {query: {match: {title: The Cruise}}} | ||
response: | ||
status: 200 |
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 |
---|---|---|
|
@@ -36,4 +36,4 @@ chapters: | |
status: 200 | ||
payload: | ||
_shards: | ||
failed: 0 | ||
failed: 0 |
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,49 @@ | ||
$schema: ../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test validating queries for a specific index using both GET and POST methods. | ||
epilogues: | ||
- path: /movies | ||
method: DELETE | ||
status: [200, 404] | ||
prologues: | ||
- path: /_bulk | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
content_type: application/x-ndjson | ||
payload: | ||
- {create: {_index: movies, _id: movie1}} | ||
- {director: Bennett Miller, title: The Cruise, year: 1998} | ||
- {create: {_index: movies, _id: movie2}} | ||
- {director: Nicolas Winding Refn, title: Drive, year: 1960} | ||
chapters: | ||
- synopsis: Validate a match query (GET). | ||
path: /{index}/_validate/query | ||
method: GET | ||
parameters: | ||
index: movies | ||
request: | ||
payload: | ||
query: | ||
match: | ||
year: 1998 | ||
response: | ||
status: 200 | ||
payload: | ||
valid: true | ||
|
||
- synopsis: Validate a match query (POST). | ||
path: /{index}/_validate/query | ||
method: POST | ||
parameters: | ||
index: movies | ||
request: | ||
payload: | ||
query: | ||
match: | ||
title: Drive | ||
response: | ||
status: 200 | ||
payload: | ||
valid: true |