Open loren opened 5 years ago
Pinging @elastic/es-search
One possible workaround for the query_string
queries I have is to use a highlight_query
like this:
POST test/_search
{
"query": {
"query_string": {
"query": """ "paul jones" """
}
},
"highlight": {
"fields": {
"voter": {
"highlight_query": {
"match": {
"voter": """ "paul jones" """
}
}
}
}
}
}
The match
doesn't care about phrases and will just find and highlight individual words.
It is still the issue in 8.12
Pinging @elastic/es-search-relevance (Team:Search Relevance)
Elasticsearch version (
bin/elasticsearch --version
):Version: 6.6.0, Build: default/tar/a9861f4/2019-01-24T11:27:09.439740Z, JVM: 1.8.0_112
Plugins installed: []
JVM version (
java -version
):OS version (
uname -a
if on a Unix-like system):Description of the problem including expected versus actual behavior: When I index a
text
field withindex_phrases
enabled, query it withmatch_phrase
, and request highlighting, Elasticsearch does not return any highlights with the hit. I expected a highlight to be returned. When I query the same field withmatch
instead ofmatch_phrase
, Elasticsearch returns the expected highlight.When I index the same
text
field withoutindex_phrases
, query it withmatch_phrase
, and request highlighting, Elasticsearch returns the expected highlight.Initially posted here.
Steps to reproduce: