Skip to content

Commit 448ff16

Browse files
committed
[DOCS] Clarify phrase suggester docs smoothing parameter (#42947)
Closes #28512
1 parent a893a57 commit 448ff16

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

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

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,10 @@ POST _search
269269

270270
The `phrase` suggester supports multiple smoothing models to balance
271271
weight between infrequent grams (grams (shingles) are not existing in
272-
the index) and frequent grams (appear at least once in the index).
272+
the index) and frequent grams (appear at least once in the index). The
273+
smoothing model can be selected by setting the `smoothing` parameter
274+
to one of the following options. Each smoothing model supports specific
275+
properties that can be configured.
273276

274277
[horizontal]
275278
`stupid_backoff`::
@@ -290,6 +293,28 @@ the index) and frequent grams (appear at least once in the index).
290293
All parameters (`trigram_lambda`, `bigram_lambda`, `unigram_lambda`)
291294
must be supplied.
292295

296+
[source,js]
297+
--------------------------------------------------
298+
POST _search
299+
{
300+
"suggest": {
301+
"text" : "obel prize",
302+
"simple_phrase" : {
303+
"phrase" : {
304+
"field" : "title.trigram",
305+
"size" : 1,
306+
"smoothing" : {
307+
"laplace" : {
308+
"alpha" : 0.7
309+
}
310+
}
311+
}
312+
}
313+
}
314+
}
315+
--------------------------------------------------
316+
// CONSOLE
317+
293318
==== Candidate Generators
294319

295320
The `phrase` suggester uses candidate generators to produce a list of

0 commit comments

Comments
 (0)