Skip to content

Fix Fast Vector Highlighter NPE on match phrase prefix#25116

Merged
jimczi merged 2 commits intoelastic:masterfrom
jimczi:fix/multi_phrase_prefix
Jun 8, 2017
Merged

Fix Fast Vector Highlighter NPE on match phrase prefix#25116
jimczi merged 2 commits intoelastic:masterfrom
jimczi:fix/multi_phrase_prefix

Conversation

@jimczi
Copy link
Copy Markdown
Contributor

@jimczi jimczi commented Jun 7, 2017

The FVH fails with an NPE when a match phrase prefix is rewritten in an empty phrase query.
This change makes sure that the multi match query rewrites to a MatchNoDocsQuery (instead of an empty phrase query) when there is
a single term and that term does not expand to any term in the index.

Fixes #25088

The FVH fails with an NPE when a match phrase prefix is rewritten in an empty phrase query.
This change makes sure that the multi match query rewrites to a MatchNoDocsQuery (instead of an empty phrase query) when there is
a single term and that term does not expand to any term in the index.

Fixes elastic#25088
@jimczi jimczi merged commit eeac4b9 into elastic:master Jun 8, 2017
@jimczi jimczi deleted the fix/multi_phrase_prefix branch June 8, 2017 10:27
jimczi added a commit that referenced this pull request Jun 8, 2017
The FVH fails with an NPE when a match phrase prefix is rewritten in an empty phrase query.
This change makes sure that the multi match query rewrites to a MatchNoDocsQuery (instead of an empty phrase query) when there is
a single term and that term does not expand to any term in the index.

Fixes #25088
jimczi added a commit that referenced this pull request Jun 8, 2017
The FVH fails with an NPE when a match phrase prefix is rewritten in an empty phrase query.
This change makes sure that the multi match query rewrites to a MatchNoDocsQuery (instead of an empty phrase query) when there is
a single term and that term does not expand to any term in the index.

Fixes #25088
@jimczi
Copy link
Copy Markdown
Contributor Author

jimczi commented Jun 8, 2017

Thanks @jpountz

@v1r the fix will be available in 5.5.0 but you can also workaround this bug in 5.4 by replacing phrase_prefix query with a simple prefix query when there is a single term.

@v1r
Copy link
Copy Markdown

v1r commented Jun 8, 2017

@jpountz Thank you very much!!

@v1r
Copy link
Copy Markdown

v1r commented Jun 8, 2017

@jpountz @jpountz The prefix query is not analyzed, do you have any idea how I can get around that ? Thanks in advance!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No highlights returned using dis_max with multi_match queries

4 participants