# ElasticSearch Highlight

**URL:** <https://discuss.elastic.co/t/elasticsearch-highlight/201512>\
**Category:** Elasticsearch\
**Created:** [September 29, 2019, 1:48am UTC](https://discuss.elastic.co/t/elasticsearch-highlight/201512 "2019-09-29T01:48:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gowd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gowd/32/42180_2.png) [@Gowd](https://discuss.elastic.co/u/Gowd)\
**Post date:** [September 29, 2019, 1:48am UTC](https://discuss.elastic.co/t/elasticsearch-highlight/201512/1 "2019-09-29T01:48:16Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 27, 2019, 1:48am UTC](https://discuss.elastic.co/t/elasticsearch-highlight/201512/2 "2019-10-27T01:48:23Z")

</div>

Closed on October 27, 2019, 1:48am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
