Skip to content

Commit 2da0611

Browse files
mfnspinscale
authored andcommitted
[DOCS] Completion suggest: Clarify de-duplication, optimize/merge
This contribution is based on the feedback given in issue elastic#4254 and issue elastic#4255, and should clear things up, when suggestions are being removed and not displayed anymore after deletion of data.
1 parent 9f57dc1 commit 2da0611

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ The following parameters are supported:
112112
`output`::
113113
The string to return, if a suggestion matches. This is very
114114
useful to normalize outputs (i.e. have them always in the format
115-
`artist - songname`). This is optional.
115+
`artist - songname`). The result is de-duplicated if several documents
116+
have the same output, i.e. only one is returned as part of the
117+
suggest result. This is optional.
116118

117119
`payload`::
118120
An arbitrary JSON object, which is simply returned in the
@@ -124,7 +126,7 @@ The following parameters are supported:
124126
A positive integer, which defines a weight and allows you to
125127
rank your suggestions. This field is optional.
126128

127-
[NOTE] Even though you are losing most of the features of the
129+
NOTE: Even though you are losing most of the features of the
128130
completion suggest, you can opt in for the shortest form, which even
129131
allows you to use inside of multi_field. But keep in mind, that you will
130132
not be able to use several inputs, an output, payloads or weights.
@@ -136,6 +138,11 @@ not be able to use several inputs, an output, payloads or weights.
136138
}
137139
--------------------------------------------------
138140

141+
NOTE: The suggest data structure might not reflect deletes on
142+
documents immediately. You may need to do an <<indices-optimize>> for that.
143+
You can call optimize with the `only_expunge_deletes=true` to only cater for deletes
144+
or alternatively call a <<index-modules-merge>> operation.
145+
139146
[[querying]]
140147
==== Querying
141148

0 commit comments

Comments
 (0)