Skip to content

Commit 7816f04

Browse files
committed
Merge pull request elastic#11445 from areek/fix/deprecate_collate_filter
DOCS: Deprecate filter option in PhraseSuggester collate Collate filter option is removed in v2.0.0, use collate query for collation in PhraseSuggester. see elastic#11195
2 parents a837c9c + 380046a commit 7816f04

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -162,19 +162,20 @@ can contain misspellings (See parameter descriptions below).
162162
is wrapped rather than each token.
163163

164164
`collate`::
165-
Checks each suggestion against the specified `query` or `filter` to
166-
prune suggestions for which no matching docs exist in the index.
167-
The collate query for a suggestion is run only on the local shard from which
168-
the suggestion has been generated from. Either a `query` or a `filter` must
169-
be specified, and it is run as a <<query-dsl-template-query,`template` query>>.
170-
The current suggestion is automatically made available as the `{{suggestion}}`
171-
variable, which should be used in your query/filter. You can still specify
172-
your own template `params` -- the `suggestion` value will be added to the
173-
variables you specify. Additionally, you can specify a `prune` to control
174-
if all phrase suggestions will be returned, when set to `true` the suggestions
175-
will have an additional option `collate_match`, which will be `true` if
176-
matching documents for the phrase was found, `false` otherwise.
177-
The default value for `prune` is `false`.
165+
Checks each suggestion against a specified `query` to prune suggestions
166+
for which no matching docs exist in the index. The collate query for a
167+
suggestion is run only on the local shard from which the suggestion has
168+
been generated from. A `query` must be specified, and it is run as a
169+
<<query-dsl-template-query,`template` query>>. The current suggestion is
170+
automatically made available as the `{{suggestion}}` variable, which
171+
should be used in your query. You can still specify your own template
172+
`params` -- the `suggestion` value will be added to the variables you specify.
173+
Additionally, you can specify a `prune` to control if all phrase suggestions
174+
will be returned, when set to `true` the suggestions will have an additional
175+
option `collate_match`, which will be `true` if matching documents for the
176+
phrase was found, `false` otherwise. The default value for `prune` is `false`.
177+
The option of specifying a `filter` has been deprecated in v1.6.0 and will be
178+
removed in v2.0.0.
178179

179180
[source,js]
180181
--------------------------------------------------

src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggestionBuilder.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,19 +182,12 @@ public PhraseSuggestionBuilder collateQuery(String collateQuery) {
182182
/**
183183
* Sets a filter used for filtering out suggested phrases (collation).
184184
*/
185+
@Deprecated
185186
public PhraseSuggestionBuilder collateFilter(String collateFilter) {
186187
this.collateFilter = collateFilter;
187188
return this;
188189
}
189190

190-
/**
191-
* Sets routing preferences for executing filter query (collation).
192-
*/
193-
public PhraseSuggestionBuilder collatePreference(String collatePreference) {
194-
this.collatePreference = collatePreference;
195-
return this;
196-
}
197-
198191
/**
199192
* Sets additional params for collate script
200193
*/

0 commit comments

Comments
 (0)