Skip to content

Commit 4df08ea

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

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
@@ -95,12 +95,18 @@ end::allow-no-match-transforms2[]
9595
tag::analyzer[]
9696
`analyzer`::
9797
(Optional, string) Analyzer to use for the query string.
98+
+
99+
This parameter can only be used when the `q` query string parameter is
100+
specified.
98101
end::analyzer[]
99102

100103
tag::analyze_wildcard[]
101104
`analyze_wildcard`::
102-
(Optional, Boolean) If `true`, wildcard and prefix queries are
103-
analyzed. Defaults to `false`.
105+
(Optional, Boolean) If `true`, wildcard and prefix queries are analyzed.
106+
Defaults to `false`.
107+
+
108+
This parameter can only be used when the `q` query string parameter is
109+
specified.
104110
end::analyze_wildcard[]
105111

106112
tag::bytes[]
@@ -151,6 +157,9 @@ tag::default_operator[]
151157
`default_operator`::
152158
(Optional, string) The default operator for query string query: AND or OR.
153159
Defaults to `OR`.
160+
+
161+
This parameter can only be used when the `q` query string parameter is
162+
specified.
154163
end::default_operator[]
155164

156165
tag::dest[]
@@ -179,8 +188,11 @@ end::detailed[]
179188

180189
tag::df[]
181190
`df`::
182-
(Optional, string) Field to use as default where no field prefix is
183-
given in the query string.
191+
(Optional, string) Field to use as default where no field prefix is given in the
192+
query string.
193+
+
194+
This parameter can only be used when the `q` query string parameter is
195+
specified.
184196
end::df[]
185197

186198
tag::docs-count[]
@@ -547,8 +559,12 @@ end::component-template[]
547559

548560
tag::lenient[]
549561
`lenient`::
550-
(Optional, Boolean) If `true`, format-based query failures (such as
551-
providing text to a numeric field) will be ignored. Defaults to `false`.
562+
(Optional, Boolean) If `true`, format-based query failures (such as providing
563+
text to a numeric field) in the query string will be ignored. Defaults to
564+
`false`.
565+
+
566+
This parameter can only be used when the `q` query string parameter is
567+
specified.
552568
end::lenient[]
553569

554570
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)