Skip to content

Commit 2f03aa4

Browse files
authored
[DOCS] Re-add several query params to search API docs (#79716) (#79735)
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 # Conflicts: # docs/reference/rest-api/common-parms.asciidoc
1 parent e9c9e86 commit 2f03aa4

File tree

2 files changed

+53
-4
lines changed

2 files changed

+53
-4
lines changed

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,18 @@ end::allow-no-match-transforms2[]
9696
tag::analyzer[]
9797
`analyzer`::
9898
(Optional, string) Analyzer to use for the query string.
99+
+
100+
This parameter can only be used when the `q` query string parameter is
101+
specified.
99102
end::analyzer[]
100103

101104
tag::analyze_wildcard[]
102105
`analyze_wildcard`::
103106
(Optional, boolean) If `true`, wildcard and prefix queries are
104107
analyzed. Defaults to `false`.
108+
+
109+
This parameter can only be used when the `q` query string parameter is
110+
specified.
105111
end::analyze_wildcard[]
106112

107113
tag::bytes[]
@@ -152,6 +158,9 @@ tag::default_operator[]
152158
`default_operator`::
153159
(Optional, string) The default operator for query string query: AND or OR.
154160
Defaults to `OR`.
161+
+
162+
This parameter can only be used when the `q` query string parameter is
163+
specified.
155164
end::default_operator[]
156165

157166
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[]
@@ -539,8 +551,12 @@ end::component-template[]
539551

540552
tag::lenient[]
541553
`lenient`::
542-
(Optional, boolean) If `true`, format-based query failures (such as
543-
providing text to a numeric field) will be ignored. Defaults to `false`.
554+
(Optional, Boolean) If `true`, format-based query failures (such as providing
555+
text to a numeric field) in the query string will be ignored. Defaults to
556+
`false`.
557+
+
558+
This parameter can only be used when the `q` query string parameter is
559+
specified.
544560
end::lenient[]
545561

546562
tag::level[]

docs/reference/search/search.asciidoc

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

60+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=analyzer]
61+
62+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=analyze_wildcard]
63+
6064
`batched_reduce_size`::
6165
(Optional, integer) The number of shard results that should be reduced at once
6266
on the coordinating node. This value should be used as a protection mechanism
@@ -69,6 +73,10 @@ shards in the request can be large. Defaults to `512`.
6973
coordinating node and the remote clusters are minimized when executing
7074
{ccs} (CCS) requests. See <<ccs-network-delays>>. Defaults to `true`.
7175

76+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=default_operator]
77+
78+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=df]
79+
7280
`docvalue_fields`::
7381
(Optional, string) A comma-separated list of fields to return as the docvalue
7482
representation of a field for each hit.
@@ -105,6 +113,8 @@ ignored when frozen. Defaults to `true`.
105113

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

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

245+
`suggest_mode`::
246+
(Optional, string) Specifies the <<search-suggesters,suggest mode>>. Defaults to
247+
`missing`. Available options:
248+
+
249+
--
250+
251+
* `always`
252+
* `missing`
253+
* `popular`
254+
255+
This parameter can only be used when the `suggest_field` and `suggest_text`
256+
query string parameters are specified.
257+
--
258+
259+
`suggest_size`::
260+
(Optional, integer) Number of <<search-suggesters,suggestions>> to return.
261+
+
262+
This parameter can only be used when the `suggest_field` and `suggest_text`
263+
query string parameters are specified.
264+
235265
`suggest_text`::
236266
(Optional, string) The source text for which the suggestions should be
237267
returned.
268+
+
269+
This parameter can only be used when the `suggest_field` query string parameter
270+
is specified.
238271

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

0 commit comments

Comments
 (0)