Skip to content

Commit f734065

Browse files
authored
Extract SearchTemplateRequestBody in watcher (#1564)
* Extract search_template request body, propagate to watcher * Beautifying code * Bringing schema up to speed
1 parent ebd5372 commit f734065

File tree

4 files changed

+110
-7
lines changed

4 files changed

+110
-7
lines changed

output/schema/schema.json

Lines changed: 79 additions & 3 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 & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/watcher/_types/Input.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
* under the License.
1818
*/
1919

20-
import { Request as SearchTemplateRequest } from '@global/search_template/SearchTemplateRequest'
2120
import { Dictionary } from '@spec_utils/Dictionary'
2221
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
2322
import {
2423
ExpandWildcards,
24+
Id,
2525
IndexName,
2626
IndicesOptions,
2727
Password,
@@ -122,10 +122,30 @@ export class SearchInputRequestDefinition {
122122
indices?: IndexName[]
123123
indices_options?: IndicesOptions
124124
search_type?: SearchType
125-
template?: SearchTemplateRequest
125+
template?: SearchTemplateRequestBody
126126
rest_total_hits_as_int?: boolean
127127
}
128128

129+
// Should be kept in sync with _global/search_template/SearchTemplateRequest.body
130+
export class SearchTemplateRequestBody {
131+
/** @server_default false */
132+
explain?: boolean
133+
/**
134+
* ID of the search template to use. If no source is specified,
135+
* this parameter is required.
136+
*/
137+
id?: Id
138+
params?: Dictionary<string, UserDefinedValue>
139+
/** @server_default false */
140+
profile?: boolean
141+
/**
142+
* An inline search template. Supports the same parameters as the search API's
143+
* request body. Also supports Mustache variables. If no id is specified, this
144+
* parameter is required.
145+
*/
146+
source?: string
147+
}
148+
129149
export class SearchInputRequestBody {
130150
query: QueryContainer
131151
}

0 commit comments

Comments
 (0)