-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOCS] Add examples for mget, msearch template APIs (#3615)
(cherry picked from commit 9b3c186)
- Loading branch information
Showing
35 changed files
with
1,149 additions
and
308 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
16 changes: 16 additions & 0 deletions
16
specification/_global/field_caps/examples/request/FieldCapabilitiesRequestExample1.yaml
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,16 @@ | ||
# summary: | ||
# method_request: "POST my-index-*/_field_caps?fields=rating" | ||
description: > | ||
Run `POST my-index-*/_field_caps?fields=rating` to get field capabilities and filter indices with a query. | ||
Indices that rewrite the provided filter to `match_none` on every shard will be filtered from the response. | ||
# type: "request" | ||
value: |- | ||
{ | ||
"index_filter": { | ||
"range": { | ||
"@timestamp": { | ||
"gte": "2018" | ||
} | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
specification/_global/field_caps/examples/response/FieldCapabilitiesResponseExample1.yaml
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 @@ | ||
summary: Get two fields | ||
# type: "response" | ||
description: > | ||
A successful response from `GET _field_caps?fields=rating,title`. | ||
The field `rating` is defined as a long in `index1` and `index2` and as a `keyword` in `index3` and `index4`. | ||
The field `rating` is not aggregatable in `index1`. | ||
The field `rating` is not searchable in `index4`. | ||
The field `title` is defined as text in all indices. | ||
# response_code: 200, | ||
value: |- | ||
{ | ||
"indices": [ "index1", "index2", "index3", "index4", "index5" ], | ||
"fields": { | ||
"rating": { | ||
"long": { | ||
"metadata_field": false, | ||
"searchable": true, | ||
"aggregatable": false, | ||
"indices": [ "index1", "index2" ], | ||
"non_aggregatable_indices": [ "index1" ] | ||
}, | ||
"keyword": { | ||
"metadata_field": false, | ||
"searchable": false, | ||
"aggregatable": true, | ||
"indices": [ "index3", "index4" ], | ||
"non_searchable_indices": [ "index4" ] | ||
} | ||
}, | ||
"title": { | ||
"text": { | ||
"metadata_field": false, | ||
"searchable": true, | ||
"aggregatable": false | ||
} | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
specification/_global/field_caps/examples/response/FieldCapabilitiesResponseExample2.yaml
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 @@ | ||
summary: Get unmapped fields | ||
# type: "response" | ||
description: > | ||
A successful response from `GET _field_caps?fields=rating,title&include_unmapped`. | ||
The response contains an entry for each field that is present in some indices but not all. | ||
For example, the `rating` and `title` fields are unmapped in `index5`. | ||
# response_code: 200, | ||
value: |- | ||
{ | ||
"indices": [ "index1", "index2", "index3", "index4", "index5" ], | ||
"fields": { | ||
"rating": { | ||
"long": { | ||
"metadata_field": false, | ||
"searchable": true, | ||
"aggregatable": false, | ||
"indices": [ "index1", "index2" ], | ||
"non_aggregatable_indices": [ "index1" ] | ||
}, | ||
"keyword": { | ||
"metadata_field": false, | ||
"searchable": false, | ||
"aggregatable": true, | ||
"indices": [ "index3", "index4" ], | ||
"non_searchable_indices": [ "index4" ] | ||
} | ||
}, | ||
"title": { | ||
"text": { | ||
"metadata_field": false, | ||
"searchable": true, | ||
"aggregatable": false | ||
} | ||
} | ||
} | ||
} |
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
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
17 changes: 17 additions & 0 deletions
17
specification/_global/mget/examples/request/MultiGetRequestExample1.yaml
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,17 @@ | ||
summary: Get documents by ID | ||
# method_request: "GET /my-index-000001/_mget" | ||
description: > | ||
Run `GET /my-index-000001/_mget`. | ||
When you specify an index in the request URI, only the document IDs are required in the request body. | ||
# type: "request" | ||
value: |- | ||
{ | ||
"docs": [ | ||
{ | ||
"_id": "1" | ||
}, | ||
{ | ||
"_id": "2" | ||
} | ||
] | ||
} |
Oops, something went wrong.