Skip to content

Commit

Permalink
Merge pull request #11445 from areek/fix/deprecate_collate_filter
Browse files Browse the repository at this point in the history
DOCS: Deprecate filter option in PhraseSuggester collate
Collate filter option is removed in v2.0.0, use collate query for
collation in PhraseSuggester.
see #11195
  • Loading branch information
areek committed Jun 2, 2015
2 parents a837c9c + 380046a commit 7816f04
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
27 changes: 14 additions & 13 deletions docs/reference/search/suggesters/phrase-suggest.asciidoc
Expand Up @@ -162,19 +162,20 @@ can contain misspellings (See parameter descriptions below).
is wrapped rather than each token.

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

[source,js]
--------------------------------------------------
Expand Down
Expand Up @@ -182,19 +182,12 @@ public PhraseSuggestionBuilder collateQuery(String collateQuery) {
/**
* Sets a filter used for filtering out suggested phrases (collation).
*/
@Deprecated
public PhraseSuggestionBuilder collateFilter(String collateFilter) {
this.collateFilter = collateFilter;
return this;
}

/**
* Sets routing preferences for executing filter query (collation).
*/
public PhraseSuggestionBuilder collatePreference(String collatePreference) {
this.collatePreference = collatePreference;
return this;
}

/**
* Sets additional params for collate script
*/
Expand Down

0 comments on commit 7816f04

Please sign in to comment.