Skip to content

Commit 0569ab1

Browse files
authored
[DOCS] Re-add several query params to search API docs (#79716) (#79729)
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 ab3ec1a commit 0569ab1

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
@@ -74,12 +74,18 @@ end::allow-no-match-transforms2[]
7474
tag::analyzer[]
7575
`analyzer`::
7676
(Optional, string) Analyzer to use for the query string.
77+
+
78+
This parameter can only be used when the `q` query string parameter is
79+
specified.
7780
end::analyzer[]
7881

7982
tag::analyze_wildcard[]
8083
`analyze_wildcard`::
81-
(Optional, Boolean) If `true`, wildcard and prefix queries are
82-
analyzed. Defaults to `false`.
84+
(Optional, Boolean) If `true`, wildcard and prefix queries are analyzed.
85+
Defaults to `false`.
86+
+
87+
This parameter can only be used when the `q` query string parameter is
88+
specified.
8389
end::analyze_wildcard[]
8490

8591
tag::bytes[]
@@ -139,6 +145,9 @@ tag::default_operator[]
139145
`default_operator`::
140146
(Optional, string) The default operator for query string query: AND or OR.
141147
Defaults to `OR`.
148+
+
149+
This parameter can only be used when the `q` query string parameter is
150+
specified.
142151
end::default_operator[]
143152

144153
tag::dest[]
@@ -167,8 +176,11 @@ end::detailed[]
167176

168177
tag::df[]
169178
`df`::
170-
(Optional, string) Field to use as default where no field prefix is
171-
given in the query string.
179+
(Optional, string) Field to use as default where no field prefix is given in the
180+
query string.
181+
+
182+
This parameter can only be used when the `q` query string parameter is
183+
specified.
172184
end::df[]
173185

174186
tag::docs-count[]
@@ -557,8 +569,12 @@ end::component-template[]
557569

558570
tag::lenient[]
559571
`lenient`::
560-
(Optional, Boolean) If `true`, format-based query failures (such as
561-
providing text to a numeric field) will be ignored. Defaults to `false`.
572+
(Optional, Boolean) If `true`, format-based query failures (such as providing
573+
text to a numeric field) in the query string will be ignored. Defaults to
574+
`false`.
575+
+
576+
This parameter can only be used when the `q` query string parameter is
577+
specified.
562578
end::lenient[]
563579

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