Skip to content

Commit ba6f695

Browse files
committed
More
1 parent 1f2c3ca commit ba6f695

7 files changed

+83
-0
lines changed

docs/overlays/elasticsearch-shared-overlays.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,3 +1360,23 @@ actions:
13601360
examples:
13611361
searchApplicationsListResponseExample1:
13621362
$ref: "../../specification/search_application/list/SearchApplicationsListResponseExample1.yaml"
1363+
## Examples for search applications
1364+
- target: "$.paths['/_application/search_application/{name}']['get']"
1365+
description: "Add examples for get search application details operation"
1366+
update:
1367+
responses:
1368+
200:
1369+
content:
1370+
application/json:
1371+
examples:
1372+
getSearchApplicationRequestExample1:
1373+
$ref: "../../specification/search_application/get/SearchApplicationGetResponseExample1.yaml"
1374+
- target: "$.paths['/_application/search_application/{name}']['put']"
1375+
description: "Add examples for create search application operation"
1376+
update:
1377+
requestBody:
1378+
content:
1379+
application/json:
1380+
examples:
1381+
putSearchApplicationRequestExample1:
1382+
$ref: "../../specification/search_application/put/SearchApplicationPutRequestExample1.yaml"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# summary: search-application/apis/get-search-application.asciidoc:95
2+
description: A sucessful response from `GET _application/search_application/my-app/`.
3+
# type: response
4+
# response_code: ''
5+
value:
6+
"{\n \"name\": \"my-app\",\n \"indices\": [ \"index1\", \"index2\" ],\n \
7+
\ \"updated_at_millis\": 1682105622204,\n \"template\": {\n \"script\": {\n\
8+
\ \"source\": {\n \"query\": {\n \"query_string\": {\n \
9+
\ \"query\": \"{{query_string}}\",\n \"default_field\": \"{{default_field}}\"\
10+
\n }\n }\n },\n \"lang\": \"mustache\",\n \"options\"\
11+
: {\n \"content_type\": \"application/json;charset=utf-8\"\n },\n \
12+
\ \"params\": {\n \"query_string\": \"*\",\n \"default_field\"\
13+
: \"*\"\n }\n }\n }\n}"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
summary: search-application/apis/list-search-applications.asciidoc:108
2+
description: ''
3+
type: response
4+
response_code: ''
5+
value:
6+
"{\n \"count\": 2,\n \"results\": [\n {\n \"name\": \"app-1\",\n\
7+
\ \"updated_at_millis\": 1690981129366\n },\n {\n \"name\": \"app-2\"\
8+
,\n \"updated_at_millis\": 1691501823939\n }\n ]\n}"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# summary: search-application/apis/put-search-application.asciidoc:148
2+
# method_request: PUT _application/search_application/my-app
3+
description: >
4+
Run `PUT _application/search_application/my-app` to create or update a search application called `my-app`. When the dictionary parameter is specified, the search application search API will perform the following parameter validation: it accepts only the `query_string` and `default_field` parameters; it verifies that `query_string` and `default_field` are both strings; it accepts `default_field` only if it takes the values title or description. If the parameters are not valid, the search application search API will return an error.
5+
# type: request
6+
value:
7+
"{\n \"indices\": [ \"index1\", \"index2\" ],\n \"template\": {\n \"script\"\
8+
: {\n \"source\": {\n \"query\": {\n \"query_string\": {\n\
9+
\ \"query\": \"{{query_string}}\",\n \"default_field\": \"\
10+
{{default_field}}\"\n }\n }\n },\n \"params\": {\n \
11+
\ \"query_string\": \"*\",\n \"default_field\": \"*\"\n }\n },\n\
12+
\ \"dictionary\": {\n \"properties\": {\n \"query_string\": {\n \
13+
\ \"type\": \"string\"\n },\n \"default_field\": {\n \
14+
\ \"type\": \"string\",\n \"enum\": [\n \"title\",\n \
15+
\ \"description\"\n ]\n },\n \"additionalProperties\"\
16+
: false\n },\n \"required\": [\n \"query_string\"\n ]\n \
17+
\ }\n }\n}"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
summary: search-application/apis/search-application-search.asciidoc:125
2+
method_request: POST _application/search_application/my-app/_search
3+
description: ''
4+
type: request
5+
value:
6+
"{\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\"\
7+
: [\n {\"name\": \"title\", \"boost\": 5},\n {\"name\": \"description\"\
8+
, \"boost\": 1}\n ]\n }\n}"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
summary: search-application/apis/search-application-search.asciidoc:141
2+
description: ''
3+
type: response
4+
response_code: ''
5+
value:
6+
"{\n \"from\": 0,\n \"size\": 10,\n \"query\": {\n \"multi_match\": {\n\
7+
\ \"query\": \"my first query\",\n \"fields\": [\n \"description^1.0\"\
8+
,\n \"title^5.0\"\n ]\n }\n },\n \"explain\": false\n}"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
summary: search-application/apis/search-application-search.asciidoc:166
2+
description: ''
3+
type: response
4+
response_code: ''
5+
value:
6+
"{\n \"took\": 5,\n \"timed_out\": false,\n \"_shards\": {\n \"total\"\
7+
: 1,\n \"successful\": 1,\n \"skipped\": 0,\n \"failed\": 0\n },\n \"\
8+
hits\": {\n \"total\": {\n \"value\": 1,\n \"relation\": \"eq\"\n \
9+
\ },\n \"max_score\": 0.8630463,\n \"hits\": ...\n }\n}"

0 commit comments

Comments
 (0)