Skip to content

Commit 73602db

Browse files
szabostevelcawl
andauthored
Adds async search API request and response examples (#2780)
Co-authored-by: lcawl <[email protected]>
1 parent 9b0de25 commit 73602db

7 files changed

+59
-3
lines changed

docs/overlays/elasticsearch-serverless-openapi-overlays.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,24 @@ actions:
1111
**Technical preview**
1212
This functionality is in technical preview and may be changed or removed in a future release.
1313
Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
14+
- target: "$.components['requestBodies']['async_search.submit']"
15+
description: "Add example for asynch search submit request"
16+
update:
17+
content:
18+
application/json:
19+
examples:
20+
asyncSearchSubmitResponseExample1:
21+
$ref: "../../specification/async_search/submit/AsyncSearchSubmitRequestExample1.json"
22+
- target: "$.components['responses']['async_search.submit#200']"
23+
description: "Add example for asynch search submit response"
24+
update:
25+
content:
26+
application/json:
27+
examples:
28+
asyncSearchSubmitResponseExample1:
29+
$ref: "../../specification/async_search/submit/AsyncSearchSubmitResponseExample1.json"
1430
- target: "$.paths['/_transform/{transform_id}']['put']"
15-
description: "Update create transform operation"
31+
description: "Add examples for create transform operation"
1632
update:
1733
requestBody:
1834
content:
@@ -29,5 +45,3 @@ actions:
2945
examples:
3046
createTransformResponseExample1:
3147
$ref: "../../specification/transform/put_transform/examples/200_response/PutTransformResponseExample1.json"
32-
33-
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"summary": "A succesful response when retrieving the results of a previously submitted async search request given its identifier.",
3+
"description": "",
4+
"type": "response",
5+
"response_code": 200,
6+
"value": "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_partial\" : false,\n \"is_running\" : false,\n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986,\n \"completion_time_in_millis\" : 1583945903130,\n \"response\" : {\n \"took\" : 12144,\n \"timed_out\" : false,\n \"num_reduce_phases\" : 46,\n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 188,\n \"skipped\" : 0,\n \"failed\" : 0\n },\n \"hits\" : {\n \"total\" : {\n \"value\" : 456433,\n \"relation\" : \"eq\"\n },\n \"max_score\" : null,\n \"hits\" : [ ]\n },\n \"aggregations\" : {\n \"sale_date\" : {\n \"buckets\" : []\n }\n }\n }\n}"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"summary": "A succesful response when retrieving the status of a previously submitted and completed async search without the results.",
3+
"description": "For an async search that has been completed, the status response has an additional `completion_status` field that shows the status code of the completed async search which was – in this case – a success.",
4+
"type": "response",
5+
"response_code": 200,
6+
"value": "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_running\" : false,\n \"is_partial\" : false,\n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986,\n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 562,\n \"skipped\" : 0,\n \"failed\" : 0\n },\n \"completion_status\" : 200\n}"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"summary": "A succesful response when retrieving the status of a previously submitted and completed async search without the results.",
3+
"description": "For an async search that has been completed, the status response has an additional `completion_status` field that shows the status code of the completed async search which was completed – in this case – with an error.",
4+
"type": "response",
5+
"response_code": 200,
6+
"value": "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_running\" : false,\n \"is_partial\" : true,\n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986,\n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 450,\n \"skipped\" : 0,\n \"failed\" : 112\n },\n \"completion_status\" : 503\n}"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"summary": "A succesful response when retrieving the status of a previously submitted async search without the results.",
3+
"description": "",
4+
"type": "response",
5+
"response_code": 200,
6+
"value": "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_running\" : true,\n \"is_partial\" : true,\n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986,\n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 188,\n \"skipped\" : 0,\n \"failed\" : 0\n }\n}"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"summary": "Performs a search request asynchronously.",
3+
"method_request": "POST /sales*/_async_search?size=0",
4+
"description": "Accepts the same parameters and request body as the search API.",
5+
"type": "request",
6+
"value": "{\n \"sort\": [\n { \"date\": { \"order\": \"asc\" } }\n ],\n \"aggs\": {\n \"sale_date\": {\n \"date_histogram\": {\n \"field\": \"date\",\n \"calendar_interval\": \"1d\"\n }\n }\n }\n}"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"summary": "A successful response when performing search asynchronously.",
3+
"description": "",
4+
"type": "response",
5+
"response_code": 200,
6+
"value": "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_partial\" : true,\n \"is_running\" : true,\n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986,\n \"response\" : {\n \"took\" : 1122,\n \"timed_out\" : false,\n \"num_reduce_phases\" : 0,\n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 3,\n \"skipped\" : 0,\n \"failed\" : 0\n },\n \"hits\" : {\n \"total\" : {\n \"value\" : 157483,\n \"relation\" : \"gte\"\n },\n \"max_score\" : null,\n \"hits\" : [ ]\n }\n }\n}"
7+
}

0 commit comments

Comments
 (0)