Closed seco-mgabor closed 3 years ago
Pinging @elastic/es-search (Team:Search)
Hi there, I would like to know how long does it take until an analysis gets started for a ticket. Thanks!
@seco-mgabor would you be able to add more details to the reproduction, including a mapping and example document? That helps ensure we fully understand the bug you're running into.
As an initial note, I tried to reproduce on my own, and suspect the problem is with match_phrase_prefix
. If I change this to match_phrase
, then we return highlights (given the query still matches).
@jtibshirani thank you for your answer. Please let me try your suggestion first. :)
As you've suggested, this solution works. A million thanks!
But how should match_phrase_prefix
be replaced? I mean, match_phrase_prefix
will find me Angular JS if I search for angular, but match_phrase
won't.
Also, I need an explanation why it worked before and stopped working with the upgrade to 7.6.2?
What I have tried too was search_as_you_type
but that doesn't work with highlighting either. :(
I've provided the mapping and some sample data, I hope someone can take a look at this issue.
Thank you @seco-mgabor for the reproduction steps. I confirmed that this is a bug: the unified
highlighter (which is the default) does not give correct highlights on match_phrase_prefix
queries. This regression happened in Elasticsearch 7.3, it works in 7.2 and before .
We still need to debug what caused the regression. Until we fix it, the options are to use a different highlighter type like plain
or switch to a new query (given your use case, these may not be possible), or to use ES 7.2.
But how should match_phrase_prefix be replaced?
Sorry for the confusion, I was not suggesting that match_phrase
was a direct replacement for match_phrase_prefix
. I was only noting that the bug seems related to match_phrase_prefix
in particular.
Salut @jtibshirani ,
thanks a lot for your answer. Well, I was asking myself the same questions.
First of all, I need to see what's the plain
highlighter as I am not very experienced using Elastic.
Unfortunately 7.2 is not an option, as it has reached EOL already. :(
Theoretically, we can migrate to SpringBoot 2.4.x, which is compatible with Elastic 7.9.3. But there's already trouble with migration to 7.6.2, I'm honestly doubting that would be easier.
Just as an accolade, according to this only the 7.6.2 is compatible with SpringBoot 2.3.x.
Regards, MG
I did some debugging on this and think I found a difference that was introduced shortly after 7.2 while updating to a newer Lucene snapshot. Some changes in the CustomUnifiedHighlighter
s query rewrite logic seems to have changed. Will open a PR shortly to dicuss the possible fix there.
Yeeey!!! Thanks for the good news!
May I ask in which version will be this fix available?
I backported the PR to 7.14 which will be our next minor release.
Elasticsearch version (
bin/elasticsearch --version
): 7.6.2Plugins installed: []
JVM version (
java -version
): 1.8OS version (
uname -a
if on a Unix-like system): Ubuntu 5.4.0-70-generic, Elastic running as containerDescription of the problem including expected versus actual behavior: I'm trying to migrate from Elastic 6.6.2 to 7.6.2 and the queries containing highlight fields don't work any longer. The same query returns results containing highlighted values in 6.x version, but it doesn't contain any highlight field for 7.6.2. To me it looks like a regression bug.
Steps to reproduce:
Please include a minimal but complete recreation of the problem, including (e.g.) index creation, mappings, settings, query etc. The easier you make for us to reproduce it, the more likely that somebody will take the time to look at it.
Mapping is the following:
Sample data:
Here is the query, as I have it right now: