# Problem with highlight after upgrade from 0.20.4 to 0.90.9

**URL:** <https://discuss.elastic.co/t/problem-with-highlight-after-upgrade-from-0-20-4-to-0-90-9/15168>\
**Category:** Elasticsearch\
**Created:** [January 9, 2014, 10:31am UTC](https://discuss.elastic.co/t/problem-with-highlight-after-upgrade-from-0-20-4-to-0-90-9/15168 "2014-01-09T10:31:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Calle\_Arnesten](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/calle_arnesten/32/1878_2.png) [@Calle\_Arnesten](https://discuss.elastic.co/u/Calle_Arnesten)\
**Post date:** [January 9, 2014, 10:31am UTC](https://discuss.elastic.co/t/problem-with-highlight-after-upgrade-from-0-20-4-to-0-90-9/15168/1 "2014-01-09T10:31:31Z")

</div>

Hi,

I have updated ElasticSearch from 0.20.4 to 0.90.9 and have problem to get  
the highlight to work.

The following search body (JSON-stringified) worked in the old version:  
query: {  
custom\_filters\_score: {  
query: {  
query\_string: {  
query: 'test',  
fields: ['task.name^3', 'task.description']  
}  
}  
},  
size: 11,  
highlight: {  
encoder: 'html',  
fields: {  
\_all: { number\_of\_fragments: 5 },  
'task.name': {  
fragment\_size: 200  
},  
'task.description': {  
fragment\_size: 100  
},  
require\_field\_match: true  
}  
}  
}

In the new version it returns:  
{  
"took": 5,  
"timed\_out": false,  
"\_shards": {  
"total": 1,  
"successful": 1,  
"failed": 0  
},  
"hits": {  
"total": 2,  
"max\_score": 1.5957302,  
"hits": [  
{  
"\_index": "board",  
"\_type": "task",  
"\_id": "9160af7f92b9f5c769351d62650028e0",  
"\_score": 1.5957302,  
"\_source": {  
"name": "Test1",  
"description": ""  
}  
},  
{  
"\_index": "board",  
"\_type": "task",  
"\_id": "9160af7f92b9f5c769351d6265003ae4",  
"\_score": 1.5957302,  
"\_source": {  
"name": "Test2",  
"description": ""

```
            }
        }
    ]
}

```

}

In 0.20.4 each item in the "hits" array contained a "highlight" property,  
but now it doesn't. Why is that not included anymore?

Any help is appreciated.

/Calle

--  
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/600a60a9-58c0-4f0a-bfc6-29538ae72e14%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/600a60a9-58c0-4f0a-bfc6-29538ae72e14%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Calle\_Arnesten](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/calle_arnesten/32/1878_2.png) [@Calle\_Arnesten](https://discuss.elastic.co/u/Calle_Arnesten)\
**Post date:** [January 9, 2014, 1:36pm UTC](https://discuss.elastic.co/t/problem-with-highlight-after-upgrade-from-0-20-4-to-0-90-9/15168/2 "2014-01-09T13:36:03Z")

</div>

So after trying around, I have found out that if just have "name" and  
"description" and not "task.name" and "task.description" in the "highlight"  
section, the highlighting works. So is "." not supported for  
highlights in 0.90.x? Or could I do it with some other syntax?

If not, how do you solve the case where you want to query many types with a  
"name" field, but have different settings per type?

/Calle

Den torsdagen den 9:e januari 2014 kl. 11:31:31 UTC+1 skrev Calle Arnesten:

> Hi,
> 
> I have updated Elasticsearch from 0.20.4 to 0.90.9 and have problem to get  
> the highlight to work.
> 
> The following search body (JSON-stringified) worked in the old version:  
> query: {  
> custom\_filters\_score: {  
> query: {  
> query\_string: {  
> query: 'test',  
> fields: ['task.name^3', 'task.description']  
> }  
> }  
> },  
> size: 11,  
> highlight: {  
> encoder: 'html',  
> fields: {  
> \_all: { number\_of\_fragments: 5 },  
> 'task.name': {  
> fragment\_size: 200  
> },  
> 'task.description': {  
> fragment\_size: 100  
> },  
> require\_field\_match: true  
> }  
> }  
> }
> 
> In the new version it returns:  
> {  
> "took": 5,  
> "timed\_out": false,  
> "\_shards": {  
> "total": 1,  
> "successful": 1,  
> "failed": 0  
> },  
> "hits": {  
> "total": 2,  
> "max\_score": 1.5957302,  
> "hits": [  
> {  
> "\_index": "board",  
> "\_type": "task",  
> "\_id": "9160af7f92b9f5c769351d62650028e0",  
> "\_score": 1.5957302,  
> "\_source": {  
> "name": "Test1",  
> "description": ""  
> }  
> },  
> {  
> "\_index": "board",  
> "\_type": "task",  
> "\_id": "9160af7f92b9f5c769351d6265003ae4",  
> "\_score": 1.5957302,  
> "\_source": {  
> "name": "Test2",  
> "description": ""
> 
> ```
> }
> }
> ]
> }
> 
> ```
> 
> }
> 
> In 0.20.4 each item in the "hits" array contained a "highlight" property,  
> but now it doesn't. Why is that not included anymore?
> 
> Any help is appreciated.
> 
> /Calle

--  
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/3ee83405-f2f6-4db0-bc13-3880d5cff450%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3ee83405-f2f6-4db0-bc13-3880d5cff450%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:57am UTC](https://discuss.elastic.co/t/problem-with-highlight-after-upgrade-from-0-20-4-to-0-90-9/15168/3 "2017-07-06T01:57:41Z")

</div>


