Skip to content

Commit

Permalink
Fix async_search query parameter validation
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed Nov 22, 2024
1 parent 1afed69 commit 8a1ac79
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 71 deletions.
26 changes: 11 additions & 15 deletions output/openapi/elasticsearch-openapi.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 11 additions & 15 deletions output/openapi/elasticsearch-serverless-openapi.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 18 additions & 14 deletions output/schema/schema-serverless.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 18 additions & 14 deletions output/schema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions output/schema/validation-errors.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion output/typescript/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions specification/_json_spec/async_search.submit.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
"type": "boolean",
"description": "Specify whether wildcard and prefix queries should be analyzed (default: false)"
},
"ccs_minimize_roundtrips": {
"type": "boolean",
"default": false,
"description": "When doing a cross-cluster search, setting it to true may improve overall search latency, particularly when searching clusters with a large number of shards. However, when set to true, the progress of searches on the remote clusters will not be received until the search finishes on all clusters."
},
"default_operator": {
"type": "enum",
"options": ["AND", "OR"],
Expand Down Expand Up @@ -113,6 +118,16 @@
"type": "string",
"description": "Specify the node or shard the operation should be performed on (default: random)"
},
"pre_filter_shard_size": {
"type": "number",
"default": 1,
"description": "Cannot be changed: this is to enforce the execution of a pre-filter roundtrip to retrieve statistics from each shard so that the ones that surely don’t hold any document matching the query get skipped."
},
"rest_total_hits_as_int": {
"type": "boolean",
"description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response",
"default": false
},
"q": {
"type": "string",
"description": "Query in the Lucene query string syntax"
Expand Down
9 changes: 9 additions & 0 deletions specification/async_search/status/AsyncSearchStatusRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import { RequestBase } from '@_types/Base'
import { Id } from '@_types/common'
import { Duration } from '@_types/Time'

/**
* Get the async search status.
Expand All @@ -36,4 +37,12 @@ export interface Request extends RequestBase {
/** A unique identifier for the async search. */
id: Id
}
query_parameters: {
/**
* Specifies how long the async search needs to be available.
* Ongoing async searches and any saved search results are deleted after this period.
* @server_default 5d
*/
keep_alive?: Duration
}
}
5 changes: 3 additions & 2 deletions specification/async_search/submit/AsyncSearchSubmitRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ import { Duration } from '@_types/Time'
* @doc_id async-search
* @doc_tag search
*/
// NOTE: this is a SearchRequest with 3 added parameters: wait_for_completion_timeout, keep_on_completion and keep_alive
// NOTE: this is a SearchRequest with:
// * 3 added parameters: wait_for_completion_timeout, keep_on_completion and keep_alive
// * 1 removed parameters: scroll
export interface Request extends RequestBase {
path_parts: {
index?: Indices
Expand Down Expand Up @@ -122,7 +124,6 @@ export interface Request extends RequestBase {
/** @server_default true */
request_cache?: boolean
routing?: Routing
scroll?: Duration
search_type?: SearchType
stats?: string[]
stored_fields?: Fields
Expand Down

0 comments on commit 8a1ac79

Please sign in to comment.