Skip to content

Commit 6deaf54

Browse files
committed
Add search_application.render_query
1 parent 2efcd2c commit 6deaf54

File tree

10 files changed

+232
-11
lines changed

10 files changed

+232
-11
lines changed

docs/overlays/elasticsearch-openapi-overlays.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,4 +391,20 @@ actions:
391391
application/json:
392392
examples:
393393
indicesLegacyPutTemplateRequestExample1:
394-
$ref: "../../specification/indices/put_template/indicesPutTemplateRequestExample1.yaml"
394+
$ref: "../../specification/indices/put_template/indicesPutTemplateRequestExample1.yaml"
395+
- target: "$.paths['/_application/search_application/{name}/_render_query']['post']"
396+
description: "Add examples for render search application query operation"
397+
update:
398+
requestBody:
399+
content:
400+
application/json:
401+
examples:
402+
renderSearchApplicationQueryRequestExample1:
403+
$ref: "../../specification/search_application/render_query/SearchApplicationsRenderQueryRequestExample1.yaml"
404+
responses:
405+
200:
406+
content:
407+
application/json:
408+
examples:
409+
renderSearchApplicationQueryResponseExample1:
410+
$ref: "../../specification/search_application/render_query/SearchApplicationsRenderQueryResponseExample1.yaml"

output/openapi/elasticsearch-openapi.json

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 67 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/validation-errors.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -623,12 +623,6 @@
623623
],
624624
"response": []
625625
},
626-
"search_application.render_query": {
627-
"request": [
628-
"Missing request & response"
629-
],
630-
"response": []
631-
},
632626
"search_mvt": {
633627
"request": [
634628
"Request: query parameter 'grid_agg' does not exist in the json spec",

output/typescript/types.ts

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_doc_ids/table.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ search-aggregations-metrics-valuecount-aggregation,https://www.elastic.co/guide/
541541
search-aggregations-metrics-weight-avg-aggregation,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-aggregations-metrics-weight-avg-aggregation.html
542542
search-aggregations-bucket-variablewidthhistogram-aggregation,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-aggregations-bucket-variablewidthhistogram-aggregation.html
543543
search-analyzer,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-analyzer.html
544+
search-render-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-application-render-query.html
544545
search-count,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-count.html
545546
search-explain,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-explain.html
546547
search-field-caps,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-field-caps.html
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
import { RequestBase } from '@_types/Base'
20+
import { Name } from '@_types/common'
21+
import { SearchApplicationParameters } from '../_types/SearchApplicationParameters'
22+
23+
/**
24+
* Render a search application query.
25+
* Generate an Elasticsearch query using the specified query parameters and the search template associated with the search application or a default template if none is specified.
26+
* If a parameter used in the search template is not specified in `params`, the parameter's default value will be used.
27+
* The API returns the specific Elasticsearch query that would be generated and run by calling the search application search API.
28+
*
29+
* You must have `read` privileges on the backing alias of the search application.
30+
* @rest_spec_name search_application.render_query
31+
* @availability stack since=8.9.0 stability=experimental visibility=public
32+
*/
33+
export interface Request extends RequestBase {
34+
path_parts: {
35+
/**
36+
* The name of the search application to render teh query for.
37+
*/
38+
name: Name
39+
}
40+
/**
41+
* Contains parameters for a search application.
42+
*/
43+
/** @codegen_name search_application */
44+
body: SearchApplicationParameters
45+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# summary:
2+
# method_request: POST _application/search_application/my-app/_render_query
3+
# description:
4+
# type: request
5+
value:
6+
params:
7+
query_string: my first query
8+
text_fields:
9+
- name: title
10+
boost: 5
11+
- name: description
12+
boost: 1
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
export class Response {
21+
body: {}
22+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# summary: ''
2+
description: A successful response for generating a query for a search application. The `from`, `size`, and `explain` parameters were not specified in the request, so the default values specified in the search template are used.
3+
# type: response
4+
# response_code: 200
5+
value:
6+
from: 0
7+
size: 10
8+
query:
9+
multi_match:
10+
query: my first query
11+
fields:
12+
- 'description^1.0'
13+
- 'title^5.0'
14+
explain: false

0 commit comments

Comments
 (0)