Skip to content

Commit 7940e07

Browse files
authored
[DOCS] Re-add several query params to search API docs (#79716)
PR #55884 removed documentation for several query parameters from the search API docs. During tests, I failed to notice that these are valid parameters but require other parameters to use. Changes: * Notes the following search API parameters require the `q` query string parameter: * `analyzer` * `analyze_wildcard` * `default_operator` * `df` * `lenient` * Notes the following search API parameters require the `suggest_field` and `suggest_text` query parameters: * `suggest_mode` * `suggest_size` * Re-adds the above parameters to the search API docs. These changes also affect API documentation that reuses the search API parameters: * Delete by query API * Update by query API * Count API * Explain API * Validate API Closes #79674
1 parent ebb1d3a commit 7940e07

File tree

2 files changed

+55
-6
lines changed

2 files changed

+55
-6
lines changed

docs/reference/rest-api/common-parms.asciidoc

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,18 @@ end::allow-no-match-transforms2[]
6767
tag::analyzer[]
6868
`analyzer`::
6969
(Optional, string) Analyzer to use for the query string.
70+
+
71+
This parameter can only be used when the `q` query string parameter is
72+
specified.
7073
end::analyzer[]
7174

7275
tag::analyze_wildcard[]
7376
`analyze_wildcard`::
74-
(Optional, Boolean) If `true`, wildcard and prefix queries are
75-
analyzed. Defaults to `false`.
77+
(Optional, Boolean) If `true`, wildcard and prefix queries are analyzed.
78+
Defaults to `false`.
79+
+
80+
This parameter can only be used when the `q` query string parameter is
81+
specified.
7682
end::analyze_wildcard[]
7783

7884
tag::bytes[]
@@ -132,6 +138,9 @@ tag::default_operator[]
132138
`default_operator`::
133139
(Optional, string) The default operator for query string query: AND or OR.
134140
Defaults to `OR`.
141+
+
142+
This parameter can only be used when the `q` query string parameter is
143+
specified.
135144
end::default_operator[]
136145

137146
tag::dest[]
@@ -160,8 +169,11 @@ end::detailed[]
160169

161170
tag::df[]
162171
`df`::
163-
(Optional, string) Field to use as default where no field prefix is
164-
given in the query string.
172+
(Optional, string) Field to use as default where no field prefix is given in the
173+
query string.
174+
+
175+
This parameter can only be used when the `q` query string parameter is
176+
specified.
165177
end::df[]
166178

167179
tag::docs-count[]
@@ -530,8 +542,12 @@ end::component-template[]
530542

531543
tag::lenient[]
532544
`lenient`::
533-
(Optional, Boolean) If `true`, format-based query failures (such as
534-
providing text to a numeric field) will be ignored. Defaults to `false`.
545+
(Optional, Boolean) If `true`, format-based query failures (such as providing
546+
text to a numeric field) in the query string will be ignored. Defaults to
547+
`false`.
548+
+
549+
This parameter can only be used when the `q` query string parameter is
550+
specified.
535551
end::lenient[]
536552

537553
tag::level[]

docs/reference/search/search.asciidoc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ no partial results. Defaults to `true`.
7070
To override the default for this field, set the
7171
`search.default_allow_partial_results` cluster setting to `false`.
7272

73+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=analyzer]
74+
75+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=analyze_wildcard]
76+
7377
`batched_reduce_size`::
7478
(Optional, integer) The number of shard results that should be reduced at once
7579
on the coordinating node. This value should be used as a protection mechanism
@@ -82,6 +86,10 @@ shards in the request can be large. Defaults to `512`.
8286
coordinating node and the remote clusters are minimized when executing
8387
{ccs} (CCS) requests. See <<ccs-network-delays>>. Defaults to `true`.
8488

89+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=default_operator]
90+
91+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=df]
92+
8593
`docvalue_fields`::
8694
(Optional, string) A comma-separated list of fields to return as the docvalue
8795
representation of a field for each hit.
@@ -106,6 +114,8 @@ ignored when frozen. Defaults to `true`.
106114

107115
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
108116

117+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=lenient]
118+
109119
`max_concurrent_shard_requests`::
110120
(Optional, integer) Defines the number of concurrent shard requests per node
111121
this search executes concurrently. This value should be used to limit the
@@ -274,9 +284,32 @@ stored fields in the search response.
274284
`suggest_field`::
275285
(Optional, string) Specifies which field to use for suggestions.
276286

287+
`suggest_mode`::
288+
(Optional, string) Specifies the <<search-suggesters,suggest mode>>. Defaults to
289+
`missing`. Available options:
290+
+
291+
--
292+
293+
* `always`
294+
* `missing`
295+
* `popular`
296+
297+
This parameter can only be used when the `suggest_field` and `suggest_text`
298+
query string parameters are specified.
299+
--
300+
301+
`suggest_size`::
302+
(Optional, integer) Number of <<search-suggesters,suggestions>> to return.
303+
+
304+
This parameter can only be used when the `suggest_field` and `suggest_text`
305+
query string parameters are specified.
306+
277307
`suggest_text`::
278308
(Optional, string) The source text for which the suggestions should be
279309
returned.
310+
+
311+
This parameter can only be used when the `suggest_field` query string parameter
312+
is specified.
280313

281314
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=terminate_after]
282315
+

0 commit comments

Comments
 (0)