Skip to content

Commit e63d2cb

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

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
@@ -80,12 +80,18 @@ end::allow-no-match-transforms2[]
8080
tag::analyzer[]
8181
`analyzer`::
8282
(Optional, string) Analyzer to use for the query string.
83+
+
84+
This parameter can only be used when the `q` query string parameter is
85+
specified.
8386
end::analyzer[]
8487

8588
tag::analyze_wildcard[]
8689
`analyze_wildcard`::
87-
(Optional, Boolean) If `true`, wildcard and prefix queries are
88-
analyzed. Defaults to `false`.
90+
(Optional, Boolean) If `true`, wildcard and prefix queries are analyzed.
91+
Defaults to `false`.
92+
+
93+
This parameter can only be used when the `q` query string parameter is
94+
specified.
8995
end::analyze_wildcard[]
9096

9197
tag::bytes[]
@@ -145,6 +151,9 @@ tag::default_operator[]
145151
`default_operator`::
146152
(Optional, string) The default operator for query string query: AND or OR.
147153
Defaults to `OR`.
154+
+
155+
This parameter can only be used when the `q` query string parameter is
156+
specified.
148157
end::default_operator[]
149158

150159
tag::dest[]
@@ -173,8 +182,11 @@ end::detailed[]
173182

174183
tag::df[]
175184
`df`::
176-
(Optional, string) Field to use as default where no field prefix is
177-
given in the query string.
185+
(Optional, string) Field to use as default where no field prefix is given in the
186+
query string.
187+
+
188+
This parameter can only be used when the `q` query string parameter is
189+
specified.
178190
end::df[]
179191

180192
tag::docs-count[]
@@ -563,8 +575,12 @@ end::component-template[]
563575

564576
tag::lenient[]
565577
`lenient`::
566-
(Optional, Boolean) If `true`, format-based query failures (such as
567-
providing text to a numeric field) will be ignored. Defaults to `false`.
578+
(Optional, Boolean) If `true`, format-based query failures (such as providing
579+
text to a numeric field) in the query string will be ignored. Defaults to
580+
`false`.
581+
+
582+
This parameter can only be used when the `q` query string parameter is
583+
specified.
568584
end::lenient[]
569585

570586
tag::level[]

docs/reference/search/search.asciidoc

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

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

92+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=default_operator]
93+
94+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=df]
95+
8896
`docvalue_fields`::
8997
(Optional, string) A comma-separated list of fields to return as the docvalue
9098
representation of a field for each hit.
@@ -109,6 +117,8 @@ ignored when frozen. Defaults to `true`.
109117

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

120+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=lenient]
121+
112122
`max_concurrent_shard_requests`::
113123
(Optional, integer) Defines the number of concurrent shard requests per node
114124
this search executes concurrently. This value should be used to limit the
@@ -277,9 +287,32 @@ stored fields in the search response.
277287
`suggest_field`::
278288
(Optional, string) Specifies which field to use for suggestions.
279289

290+
`suggest_mode`::
291+
(Optional, string) Specifies the <<search-suggesters,suggest mode>>. Defaults to
292+
`missing`. Available options:
293+
+
294+
--
295+
296+
* `always`
297+
* `missing`
298+
* `popular`
299+
300+
This parameter can only be used when the `suggest_field` and `suggest_text`
301+
query string parameters are specified.
302+
--
303+
304+
`suggest_size`::
305+
(Optional, integer) Number of <<search-suggesters,suggestions>> to return.
306+
+
307+
This parameter can only be used when the `suggest_field` and `suggest_text`
308+
query string parameters are specified.
309+
280310
`suggest_text`::
281311
(Optional, string) The source text for which the suggestions should be
282312
returned.
313+
+
314+
This parameter can only be used when the `suggest_field` query string parameter
315+
is specified.
283316

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

0 commit comments

Comments
 (0)