Hi, I am using ElasticSearch highlights and the behavior is confusing.
Below is my document which indexed:
POST clients_with_lemma_policy_document_type_en-us/doc/D1OoeG0B0rPisNgfCVyL
{
"query": {
"bool": {
"should": [
{
"query_string": {
"query": """("knives") OR ((isLemmatisationEnabled : 1) AND "knife") """
}
}
],
"minimum_should_match": 1
}
},
"phraseConfigVersion": 0,
"mode": "BLACKLISTING",
"metadataInformation": {
"category": "offensive"
},
"phrases": [
"knives"
],
"lemmas": [
"knife"
]
}
And this is my search:
GET clients_with_lemma_policy_document_type_en-us/_search/
{
"query": {
"percolate": {
"field": "query",
"document": {
"mainText": [
"I have too many knives!!! knife."
],
"subText": "I have too many knives knife kill."
}
}
},
"highlight": {
"number_of_fragments": 0,
"fields": {
"*": {
"pre_tags": [
"<em>"
],
"post_tags": [
"</em>"
]
}
}
},
"size": 10000
}
Result:
{
"took": 12,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.2876821,
"hits": [
{
"_index": "clients_with_lemma_policy_document_type_en-us",
"_type": "doc",
"_id": "D1OoeG0B0rPisNgfCVyL",
"_score": 0.2876821,
"_source": {
"query": {
"bool": {
"should": [
{
"query_string": {
"query": """("knives") OR ((isLemmatisationEnabled : 1) AND "knife") """
}
}
],
"minimum_should_match": 1
}
},
"phraseConfigVersion": 0,
"mode": "BLACKLISTING",
"metadataInformation": {
"category": "offensive"
},
"phrases": [
"knives"
],
"lemmas": [
"knife"
]
},
"fields": {
"_percolator_document_slot": [
0
]
},
"highlight": {
"mainText": [
"I have too many knives!!! knife."
],
"subText": [
"I have too many knives knife kill."
]
}
}
]
}
}
Why is "knife" being highlighted even though the input document does not contain isLemmatisationEnabledFlag?