Skip to content

Commit b1aaa85

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

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
@@ -267,7 +267,10 @@ POST _search
267267

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

272275
[horizontal]
273276
`stupid_backoff`::
@@ -288,6 +291,28 @@ the index) and frequent grams (appear at least once in the index).
288291
All parameters (`trigram_lambda`, `bigram_lambda`, `unigram_lambda`)
289292
must be supplied.
290293

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

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

0 commit comments

Comments
 (0)