File tree Expand file tree Collapse file tree 4 files changed +23
-14
lines changed Expand file tree Collapse file tree 4 files changed +23
-14
lines changed Original file line number Diff line number Diff line change @@ -7020,15 +7020,15 @@ Creates or updates a query ruleset.
7020
7020
{ref}/put-query-ruleset.html[Endpoint documentation]
7021
7021
[source,ts]
7022
7022
----
7023
- client.queryRuleset.put({ ruleset_id })
7023
+ client.queryRuleset.put({ ruleset_id, rules })
7024
7024
----
7025
7025
7026
7026
[discrete]
7027
7027
==== Arguments
7028
7028
7029
7029
* *Request (object):*
7030
7030
** *`ruleset_id` (string)*: The unique identifier of the query ruleset to be created or updated
7031
- ** *`query_ruleset ` (Optional, { ruleset_id, rules } )*
7031
+ ** *`rules ` ({ rule_id, type, criteria, actions }[] )*
7032
7032
7033
7033
[discrete]
7034
7034
=== rollup
Original file line number Diff line number Diff line change @@ -131,15 +131,22 @@ export default class QueryRuleset {
131
131
async put ( this : That , params : T . QueryRulesetPutRequest | TB . QueryRulesetPutRequest , options ?: TransportRequestOptions ) : Promise < T . QueryRulesetPutResponse >
132
132
async put ( this : That , params : T . QueryRulesetPutRequest | TB . QueryRulesetPutRequest , options ?: TransportRequestOptions ) : Promise < any > {
133
133
const acceptedPath : string [ ] = [ 'ruleset_id' ]
134
- const acceptedBody : string [ ] = [ 'query_ruleset ' ]
134
+ const acceptedBody : string [ ] = [ 'rules ' ]
135
135
const querystring : Record < string , any > = { }
136
136
// @ts -expect-error
137
- let body : any = params . body ?? undefined
137
+ const userBody : any = params ?. body
138
+ let body : Record < string , any > | string
139
+ if ( typeof userBody === 'string' ) {
140
+ body = userBody
141
+ } else {
142
+ body = userBody != null ? { ...userBody } : undefined
143
+ }
138
144
139
145
for ( const key in params ) {
140
146
if ( acceptedBody . includes ( key ) ) {
147
+ body = body ?? { }
141
148
// @ts -expect-error
142
- body = params [ key ]
149
+ body [ key ] = params [ key ]
143
150
} else if ( acceptedPath . includes ( key ) ) {
144
151
continue
145
152
} else if ( key !== 'body' ) {
Original file line number Diff line number Diff line change @@ -3240,8 +3240,8 @@ export type AggregationsFrequentItemSetsBucket = AggregationsFrequentItemSetsBuc
3240
3240
3241
3241
export interface AggregationsFrequentItemSetsField {
3242
3242
field : Field
3243
- exclude ?: string | string [ ]
3244
- include ?: string | string [ ]
3243
+ exclude ?: AggregationsTermsExclude
3244
+ include ?: AggregationsTermsInclude
3245
3245
}
3246
3246
3247
3247
export type AggregationsGapPolicy = 'skip' | 'insert_zeros' | 'keep_values'
@@ -3856,7 +3856,7 @@ export interface AggregationsSignificantTextAggregation extends AggregationsBuck
3856
3856
field ?: Field
3857
3857
filter_duplicate_text ?: boolean
3858
3858
gnd ?: AggregationsGoogleNormalizedDistanceHeuristic
3859
- include ?: string | string [ ]
3859
+ include ?: AggregationsTermsInclude
3860
3860
jlh ?: EmptyObject
3861
3861
min_doc_count ?: long
3862
3862
mutual_information ?: AggregationsMutualInformationHeuristic
@@ -15279,7 +15279,7 @@ export interface QueryRulesetListResponse {
15279
15279
15280
15280
export interface QueryRulesetPutRequest extends RequestBase {
15281
15281
ruleset_id : Id
15282
- query_ruleset ?: QueryRulesetQueryRuleset
15282
+ rules : QueryRulesetQueryRule [ ]
15283
15283
}
15284
15284
15285
15285
export interface QueryRulesetPutResponse {
Original file line number Diff line number Diff line change @@ -3313,8 +3313,8 @@ export type AggregationsFrequentItemSetsBucket = AggregationsFrequentItemSetsBuc
3313
3313
3314
3314
export interface AggregationsFrequentItemSetsField {
3315
3315
field: Field
3316
- exclude?: string | string[]
3317
- include?: string | string[]
3316
+ exclude?: AggregationsTermsExclude
3317
+ include?: AggregationsTermsInclude
3318
3318
}
3319
3319
3320
3320
export type AggregationsGapPolicy = 'skip' | 'insert_zeros' | 'keep_values'
@@ -3929,7 +3929,7 @@ export interface AggregationsSignificantTextAggregation extends AggregationsBuck
3929
3929
field?: Field
3930
3930
filter_duplicate_text?: boolean
3931
3931
gnd?: AggregationsGoogleNormalizedDistanceHeuristic
3932
- include?: string | string[]
3932
+ include?: AggregationsTermsInclude
3933
3933
jlh?: EmptyObject
3934
3934
min_doc_count?: long
3935
3935
mutual_information?: AggregationsMutualInformationHeuristic
@@ -15574,8 +15574,10 @@ export interface QueryRulesetListResponse {
15574
15574
15575
15575
export interface QueryRulesetPutRequest extends RequestBase {
15576
15576
ruleset_id: Id
15577
- /** @deprecated The use of the 'body' key has been deprecated, use 'query_ruleset' instead. */
15578
- body?: QueryRulesetQueryRuleset
15577
+ /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */
15578
+ body?: {
15579
+ rules: QueryRulesetQueryRule[]
15580
+ }
15579
15581
}
15580
15582
15581
15583
export interface QueryRulesetPutResponse {
You can’t perform that action at this time.
0 commit comments