Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phrase suggester collate_match field erased during result merging #29485

Closed
jbaiera opened this issue Apr 11, 2018 · 5 comments
Closed

Phrase suggester collate_match field erased during result merging #29485

jbaiera opened this issue Apr 11, 2018 · 5 comments
Assignees
Labels
>bug :Search Relevance/Suggesters "Did you mean" and suggestions as you type Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch

Comments

@jbaiera
Copy link
Member

jbaiera commented Apr 11, 2018

When using a phrase suggester with a collate query and prune set to true, a suggested phrase may correspond to a successful collate search on only a couple of shards or a single shard. Since prune is enabled, the options from all shards are returned, even if failing the collate query.

When suggester options are merged at the end of a query, only the scores of the options are considered. The collate_match field values are ignored. This means that the suggester only reports that the collate_match is true for options returned from the first suggester result seen. This is mostly a problem in cases where suggested phrase is one that results in a rare hit.

It is only possible to see these false negatives in the result list when prune is enabled. Without prune enabled, the suggester will return the correct results, as the only suggestion options that are returned are those that pass the collate query.

https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/search/suggest/Suggest.java#L744

@jbaiera jbaiera added >bug :Search Relevance/Suggesters "Did you mean" and suggestions as you type labels Apr 11, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@colings86
Copy link
Contributor

@jimczi could you take a look at this one?

@jbaiera
Copy link
Member Author

jbaiera commented Apr 12, 2018

Actually, I'm going to see if I can get together a fix for this. The fix itself is really simple, just |= the boolean. I'll see if I can get a PR for this up today.

@jimczi
Copy link
Contributor

jimczi commented Apr 12, 2018

Thanks @jbaiera ! I agree this is a bug ;).

@jbaiera
Copy link
Member Author

jbaiera commented May 2, 2018

Fixed with #29514

@jbaiera jbaiera closed this as completed May 2, 2018
@bleskes bleskes added v6.3.0 and removed v6.3.1 labels May 3, 2018
@javanna javanna added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search Relevance/Suggesters "Did you mean" and suggestions as you type Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch
Projects
None yet
Development

No branches or pull requests

7 participants