I encountered a strange logical behavior while using plain highlighter.
Here is a minimal working example:
PUT /test
PUT /test/1
{"message": "m2 m3"}
GET /test/_search
{
"query": {
"bool": {
"should": [
{
"bool": {
"must": [
{
"term": {
"message": "m1"
}
},
{
"term": {
"message": "m2"
}
}
]
}
},
{
"bool": {
"must": [
{
"match": {
"message": "m3"
}
}
]
}
}
]
}
},
"highlight": {
"fields": {
"message": {}
}
}
}
This is the response i get :
{
"took": 2,
"timed_out": false,
"hits": {
"total": 1,
"max_score": 0.25811607,
"hits": [
{
"_index": "toto",
"_type": "tata",
"_id": "1",
"_score": 0.25811607,
"_source": {
"message": "m2 m3"
},
"highlight": {
"message": [
"<em>m2</em> <em>m3</em>"
]
}
}
]
}
}
Why are there highlights around m2
?