# Strange highlight result, can anyone explain it?

**URL:** <https://discuss.elastic.co/t/strange-highlight-result-can-anyone-explain-it/19092>\
**Category:** Elasticsearch\
**Created:** [August 5, 2014, 11:58am UTC](https://discuss.elastic.co/t/strange-highlight-result-can-anyone-explain-it/19092 "2014-08-05T11:58:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Ji](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@Ivan\_Ji](https://discuss.elastic.co/u/Ivan_Ji)\
**Post date:** [August 5, 2014, 11:58am UTC](https://discuss.elastic.co/t/strange-highlight-result-can-anyone-explain-it/19092/1 "2014-08-05T11:58:42Z")

</div>

Hi all,

I am using highlight function in ES 1.0.1. I found a very strange situation  
as follow:

I want to highlight the field "group.\* " which is the inside a  
dictionary, whose mapping is

{"properties": {

> "group":  
> { "type": "object",  
> "dynamic": false,  
> "include\_in\_all": true,  
> "properties": {  
> "data": {"type": "string", "index": "analyzed", "analyzer":  
> "name\_analyzer", "term\_vector": "with\_positions\_offsets",  
> "fielddata":{"format": "disabled"}},  
> "data\_2": {"type": "string", "index": "analyzed", "analyzer":  
> "nickname\_analyzer", "term\_vector": "with\_positions\_offsets",  
> "fielddata":{"format": "disabled"}},  
> ....(skip)  
> }  
> }  
> }  
> }

The analyzers of each field inside "group" are all different.

I query the word "Adobe" and I got the following result:

"highlight": {

> ```
> "group.data": [
> "I want it all, and I want it now 106\n\nUsing the 
> 
> ```
> 
> _Adobe_ ActionScript 3 SDK for Facebook platform 106\nTime",  
> "– obtaining data in pages 126\nTime for action –  
> _adding_ limit and offset to GraphRequest instances 128",  
> "requesting data based on date 131\nTime for  
> action – _adding_ since and until to GraphRequest instances  
> 133\nTime"  
> ]  
> }

by using the highlight command:

{'highlight': {'fields': {'group.\*': {'fragment\_size': 100, 'number\_of\_fragments':

> 3}}}}

As you saw, it highlight the "adding" word. I cannot understand why this  
comes.  
And I am pretty sure the analyzer of "group.data" field cannot normalize  
"Adobe" and "adding" into same form.

Any explanations? Please help me to understand what happened.

Thanks.

Ivan

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a047e9e5-410a-471d-9b10-cd03b0669197%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a047e9e5-410a-471d-9b10-cd03b0669197%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ivan\_Ji](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@Ivan\_Ji](https://discuss.elastic.co/u/Ivan_Ji)\
**Post date:** [August 5, 2014, 12:08pm UTC](https://discuss.elastic.co/t/strange-highlight-result-can-anyone-explain-it/19092/2 "2014-08-05T12:08:30Z")

</div>

The query command I used is as

{'multi\_match': {'fields': ['\_all', 'name', 'group.\*'],

> 'operator': 'and',  
> 'query': 'Adobe'}}

I doubt the problem might be because the various analyzers of the  
"group.\*".

What is the analyzer to be used during the highlight?

Ivan  
Ivan Ji於 2014年8月5日星期二UTC+8下午7時58分42秒寫道：

> Hi all,
> 
> I am using highlight function in ES 1.0.1. I found a very strange  
> situation as follow:
> 
> I want to highlight the field "group.\* " which is the inside a  
> dictionary, whose mapping is
> 
> {"properties": {
> 
> > "group":  
> > { "type": "object",  
> > "dynamic": false,  
> > "include\_in\_all": true,  
> > "properties": {  
> > "data": {"type": "string", "index": "analyzed", "analyzer":  
> > "name\_analyzer", "term\_vector": "with\_positions\_offsets",  
> > "fielddata":{"format": "disabled"}},  
> > "data\_2": {"type": "string", "index": "analyzed", "analyzer":  
> > "nickname\_analyzer", "term\_vector": "with\_positions\_offsets",  
> > "fielddata":{"format": "disabled"}},  
> > ....(skip)  
> > }  
> > }  
> > }  
> > }
> 
> The analyzers of each field inside "group" are all different.
> 
> I query the word "Adobe" and I got the following result:
> 
> "highlight": {
> 
> > ```
> > "group.data": [
> > "I want it all, and I want it now 106\n\nUsing 
> > 
> > ```
> > 
> > the _Adobe_ ActionScript 3 SDK for Facebook platform 106\nTime",  
> > "– obtaining data in pages 126\nTime for action –  
> > _adding_ limit and offset to GraphRequest instances 128",  
> > "requesting data based on date 131\nTime for  
> > action – _adding_ since and until to GraphRequest instances  
> > 133\nTime"  
> > ]  
> > }
> 
> by using the highlight command:
> 
> {'highlight': {'fields': {'group.\*': {'fragment\_size': 100, 'number\_of\_fragments':
> 
> > 3}}}}
> 
> As you saw, it highlight the "adding" word. I cannot understand why this  
> comes.  
> And I am pretty sure the analyzer of "group.data" field cannot normalize  
> "Adobe" and "adding" into same form.
> 
> Any explanations? Please help me to understand what happened.
> 
> Thanks.
> 
> Ivan

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/60fd5110-56bc-46f0-b767-e8cfc70bb7e8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/60fd5110-56bc-46f0-b767-e8cfc70bb7e8%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ivan\_Ji](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@Ivan\_Ji](https://discuss.elastic.co/u/Ivan_Ji)\
**Post date:** [August 12, 2014, 6:43am UTC](https://discuss.elastic.co/t/strange-highlight-result-can-anyone-explain-it/19092/3 "2014-08-12T06:43:27Z")

</div>

For people that face the same problems, it's because the analyzers used in  
highlight is included all the ones of the fields in the query if you don't  
turn require\_field\_match to true.

FYI.

Ivan Ji於 2014年8月5日星期二UTC+8下午8時08分31秒寫道：

> The query command I used is as
> 
> {'multi\_match': {'fields': ['\_all', 'name', 'group.\*'],
> 
> > 'operator': 'and',  
> > 'query': 'Adobe'}}
> 
> I doubt the problem might be because the various analyzers of the  
> "group.\*".
> 
> What is the analyzer to be used during the highlight?
> 
> Ivan  
> Ivan Ji於 2014年8月5日星期二UTC+8下午7時58分42秒寫道：
> 
> > Hi all,
> > 
> > I am using highlight function in ES 1.0.1. I found a very strange  
> > situation as follow:
> > 
> > I want to highlight the field "group.\* " which is the inside a  
> > dictionary, whose mapping is
> > 
> > {"properties": {
> > 
> > > "group":  
> > > { "type": "object",  
> > > "dynamic": false,  
> > > "include\_in\_all": true,  
> > > "properties": {  
> > > "data": {"type": "string", "index": "analyzed", "analyzer":  
> > > "name\_analyzer", "term\_vector": "with\_positions\_offsets",  
> > > "fielddata":{"format": "disabled"}},  
> > > "data\_2": {"type": "string", "index": "analyzed", "analyzer":  
> > > "nickname\_analyzer", "term\_vector": "with\_positions\_offsets",  
> > > "fielddata":{"format": "disabled"}},  
> > > ....(skip)  
> > > }  
> > > }  
> > > }  
> > > }
> > 
> > The analyzers of each field inside "group" are all different.
> > 
> > I query the word "Adobe" and I got the following result:
> > 
> > "highlight": {
> > 
> > > ```
> > > "group.data": [
> > > "I want it all, and I want it now 106\n\nUsing 
> > > 
> > > ```
> > > 
> > > the _Adobe_ ActionScript 3 SDK for Facebook platform 106\nTime",  
> > > "– obtaining data in pages 126\nTime for action  
> > > – _adding_ limit and offset to GraphRequest instances 128",  
> > > "requesting data based on date 131\nTime for  
> > > action – _adding_ since and until to GraphRequest instances  
> > > 133\nTime"  
> > > ]  
> > > }
> > 
> > by using the highlight command:
> > 
> > {'highlight': {'fields': {'group.\*': {'fragment\_size': 100, 'number\_of\_fragments':
> > 
> > > 3}}}}
> > 
> > As you saw, it highlight the "adding" word. I cannot understand why this  
> > comes.  
> > And I am pretty sure the analyzer of "group.data" field cannot normalize  
> > "Adobe" and "adding" into same form.
> > 
> > Any explanations? Please help me to understand what happened.
> > 
> > Thanks.
> > 
> > Ivan

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5e53c738-8b1c-45be-9573-4ab7e6447287%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5e53c738-8b1c-45be-9573-4ab7e6447287%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 1:09am UTC](https://discuss.elastic.co/t/strange-highlight-result-can-anyone-explain-it/19092/4 "2017-07-06T01:09:24Z")

</div>


