Skip to content

Commit 94d65ea

Browse files
committed
[Docs] Clarify size parameter in Completion Suggester doc (#26617)
1 parent 80d02fe commit 94d65ea

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

docs/reference/search/suggesters/completion-suggest.asciidoc

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ POST music/_search?pretty
156156
{
157157
"suggest": {
158158
"song-suggest" : {
159-
"prefix" : "nir",
160-
"completion" : {
161-
"field" : "suggest"
159+
"prefix" : "nir", <1>
160+
"completion" : { <2>
161+
"field" : "suggest" <3>
162162
}
163163
}
164164
}
@@ -167,6 +167,10 @@ POST music/_search?pretty
167167
// CONSOLE
168168
// TEST[continued]
169169

170+
<1> Prefix used to search for suggestions
171+
<2> Type of suggestions
172+
<3> Name of the field to search for suggestions in
173+
170174
returns this response:
171175

172176
[source,js]
@@ -218,14 +222,15 @@ filtering but using suggest on the `_search` endpoint does:
218222

219223
[source,js]
220224
--------------------------------------------------
221-
POST music/_search?size=0
225+
POST music/_search
222226
{
223-
"_source": "suggest",
227+
"_source": "suggest", <1>
224228
"suggest": {
225229
"song-suggest" : {
226230
"prefix" : "nir",
227231
"completion" : {
228-
"field" : "suggest"
232+
"field" : "suggest", <2>
233+
"size" : 5 <3>
229234
}
230235
}
231236
}
@@ -234,6 +239,10 @@ POST music/_search?size=0
234239
// CONSOLE
235240
// TEST[continued]
236241

242+
<1> Filter the source to return only the `suggest` field
243+
<2> Name of the field to search for suggestions in
244+
<3> Number of suggestions to return
245+
237246
Which should look like:
238247

239248
[source,js]

0 commit comments

Comments
 (0)