Skip to content

Commit 4f69ea6

Browse files
authored
[DOCS] Re-add several query params to search API docs (#79716) (#79734)
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 9923a33 commit 4f69ea6

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
@@ -92,12 +92,18 @@ end::allow-no-match-transforms2[]
9292
tag::analyzer[]
9393
`analyzer`::
9494
(Optional, string) Analyzer to use for the query string.
95+
+
96+
This parameter can only be used when the `q` query string parameter is
97+
specified.
9598
end::analyzer[]
9699

97100
tag::analyze_wildcard[]
98101
`analyze_wildcard`::
99-
(Optional, Boolean) If `true`, wildcard and prefix queries are
100-
analyzed. Defaults to `false`.
102+
(Optional, Boolean) If `true`, wildcard and prefix queries are analyzed.
103+
Defaults to `false`.
104+
+
105+
This parameter can only be used when the `q` query string parameter is
106+
specified.
101107
end::analyze_wildcard[]
102108

103109
tag::bytes[]
@@ -148,6 +154,9 @@ tag::default_operator[]
148154
`default_operator`::
149155
(Optional, string) The default operator for query string query: AND or OR.
150156
Defaults to `OR`.
157+
+
158+
This parameter can only be used when the `q` query string parameter is
159+
specified.
151160
end::default_operator[]
152161

153162
tag::dest[]
@@ -176,8 +185,11 @@ end::detailed[]
176185

177186
tag::df[]
178187
`df`::
179-
(Optional, string) Field to use as default where no field prefix is
180-
given in the query string.
188+
(Optional, string) Field to use as default where no field prefix is given in the
189+
query string.
190+
+
191+
This parameter can only be used when the `q` query string parameter is
192+
specified.
181193
end::df[]
182194

183195
tag::docs-count[]
@@ -544,8 +556,12 @@ end::component-template[]
544556

545557
tag::lenient[]
546558
`lenient`::
547-
(Optional, Boolean) If `true`, format-based query failures (such as
548-
providing text to a numeric field) will be ignored. Defaults to `false`.
559+
(Optional, Boolean) If `true`, format-based query failures (such as providing
560+
text to a numeric field) in the query string will be ignored. Defaults to
561+
`false`.
562+
+
563+
This parameter can only be used when the `q` query string parameter is
564+
specified.
549565
end::lenient[]
550566

551567
tag::level[]

docs/reference/search/search.asciidoc

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

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

82+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=default_operator]
83+
84+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=df]
85+
7886
`docvalue_fields`::
7987
(Optional, string) A comma-separated list of fields to return as the docvalue
8088
representation of a field for each hit.
@@ -111,6 +119,8 @@ ignored when frozen. Defaults to `true`.
111119

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

122+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=lenient]
123+
114124
`max_concurrent_shard_requests`::
115125
(Optional, integer) Defines the number of concurrent shard requests per node
116126
this search executes concurrently. This value should be used to limit the
@@ -294,9 +304,32 @@ stored fields in the search response.
294304
`suggest_field`::
295305
(Optional, string) Specifies which field to use for suggestions.
296306

307+
`suggest_mode`::
308+
(Optional, string) Specifies the <<search-suggesters,suggest mode>>. Defaults to
309+
`missing`. Available options:
310+
+
311+
--
312+
313+
* `always`
314+
* `missing`
315+
* `popular`
316+
317+
This parameter can only be used when the `suggest_field` and `suggest_text`
318+
query string parameters are specified.
319+
--
320+
321+
`suggest_size`::
322+
(Optional, integer) Number of <<search-suggesters,suggestions>> to return.
323+
+
324+
This parameter can only be used when the `suggest_field` and `suggest_text`
325+
query string parameters are specified.
326+
297327
`suggest_text`::
298328
(Optional, string) The source text for which the suggestions should be
299329
returned.
330+
+
331+
This parameter can only be used when the `suggest_field` query string parameter
332+
is specified.
300333

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

0 commit comments

Comments
 (0)