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

Higlighters: Fix MultiPhrasePrefixQuery rewriting #25103

Merged
merged 1 commit into from Jun 7, 2017

Conversation

Projects
None yet
3 participants
@jimczi
Member

jimczi commented Jun 7, 2017

The unified highlighter rewrites MultiPhrasePrefixQuery to SpanNearQuer even when there is a single term in the phrase.
Though SpanNearQuery throws an exception when the number of clauses is less than 2.
This change returns a simple PrefixQuery when there is a single term and builds the SpanNearQuery otherwise.

Relates #25088

Higlighters: Fix MultiPhrasePrefixQuery rewriting
The unified highlighter rewrites MultiPhrasePrefixQuery to SpanNearQuer even when there is a single term in the phrase.
Though SpanNearQuery throws an exception when the number of clauses is less than 2.
This change returns a simple PrefixQuery when there is a single term and builds the SpanNearQuery otherwise.

Relates #25088
@nik9000

nik9000 approved these changes Jun 7, 2017

@jimczi jimczi merged commit c8bf7ec into elastic:master Jun 7, 2017

2 checks passed

CLA Commit author is a member of Elasticsearch
Details
elasticsearch-ci Build finished.
Details

@jimczi jimczi deleted the jimczi:fix/unified_match_phrase_prefix branch Jun 7, 2017

@jimczi

This comment has been minimized.

Member

jimczi commented Jun 7, 2017

Thanks @nik9000 !

jimczi added a commit that referenced this pull request Jun 7, 2017

Higlighters: Fix MultiPhrasePrefixQuery rewriting (#25103)
The unified highlighter rewrites MultiPhrasePrefixQuery to SpanNearQuer even when there is a single term in the phrase.
Though SpanNearQuery throws an exception when the number of clauses is less than 2.
This change returns a simple PrefixQuery when there is a single term and builds the SpanNearQuery otherwise.

Relates #25088

jimczi added a commit that referenced this pull request Jun 7, 2017

Higlighters: Fix MultiPhrasePrefixQuery rewriting (#25103)
The unified highlighter rewrites MultiPhrasePrefixQuery to SpanNearQuer even when there is a single term in the phrase.
Though SpanNearQuery throws an exception when the number of clauses is less than 2.
This change returns a simple PrefixQuery when there is a single term and builds the SpanNearQuery otherwise.

Relates #25088

@colings86 colings86 added v6.0.0-beta1 and removed v6.0.0 labels Aug 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment