# Is there something like a highlight payload?

**URL:** <https://discuss.elastic.co/t/is-there-something-like-a-highlight-payload/14260>\
**Category:** Elasticsearch\
**Created:** [November 5, 2013, 11:48am UTC](https://discuss.elastic.co/t/is-there-something-like-a-highlight-payload/14260 "2013-11-05T11:48:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![joa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joa/32/1807_2.png) [@joa](https://discuss.elastic.co/u/joa)\
**Post date:** [November 5, 2013, 11:48am UTC](https://discuss.elastic.co/t/is-there-something-like-a-highlight-payload/14260/1 "2013-11-05T11:48:59Z")

</div>

In my mapping I have an array with objects of comments.

"comments": {  
"properties": {  
"text": {  
"type": "string"  
},  
"autor": {  
"type": "string"  
}  
}  
}

When I now search for comment texts I would like to also get the matching  
autor. Is there a way to include the autor in the highlight array?

...  
"highlight": {  
"comments.text": [  
"this is a _test_"  
]  
}  
...

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)\
**Post date:** [November 5, 2013, 12:58pm UTC](https://discuss.elastic.co/t/is-there-something-like-a-highlight-payload/14260/2 "2013-11-05T12:58:31Z")

</div>

Not really, you'd need to index every comment as a separate document  
yourself. Then each hit would be a comment, and for each comment you get  
the highlighted snippet as well.

On Tuesday, November 5, 2013 12:48:59 PM UTC+1, joa wrote:

> In my mapping I have an array with objects of comments.
> 
> "comments": {  
> "properties": {  
> "text": {  
> "type": "string"  
> },  
> "autor": {  
> "type": "string"  
> }  
> }  
> }
> 
> When I now search for comment texts I would like to also get the matching  
> autor. Is there a way to include the autor in the highlight array?
> 
> ...  
> "highlight": {  
> "comments.text": [  
> "this is a _test_"  
> ]  
> }  
> ...

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![joa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joa/32/1807_2.png) [@joa](https://discuss.elastic.co/u/joa)\
**Post date:** [November 5, 2013, 1:41pm UTC](https://discuss.elastic.co/t/is-there-something-like-a-highlight-payload/14260/3 "2013-11-05T13:41:17Z")

</div>

Thanks Luca. Considering I am using a parent/child mapping with the  
comments as child. Is it possible to get both - parent with embeded  
comments and highlighting - with one search request?

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)\
**Post date:** [November 5, 2013, 1:45pm UTC](https://discuss.elastic.co/t/is-there-something-like-a-highlight-payload/14260/4 "2013-11-05T13:45:38Z")

</div>

I don't think so. At this time with parent-child it's only possible to get  
back one of the two, either parent or children. I guess you need two  
requests here....

On Tue, Nov 5, 2013 at 2:41 PM, joa [joafeldmann@gmail.com](mailto:joafeldmann@gmail.com) wrote:

> Thanks Luca. Considering I am using a parent/child mapping with the  
> comments as child. Is it possible to get both - parent with embeded  
> comments and highlighting - with one search request?
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/teElBO1Ri0s/unsubscribe](https://groups.google.com/d/topic/elasticsearch/teElBO1Ri0s/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![joa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joa/32/1807_2.png) [@joa](https://discuss.elastic.co/u/joa)\
**Post date:** [November 5, 2013, 4:54pm UTC](https://discuss.elastic.co/t/is-there-something-like-a-highlight-payload/14260/5 "2013-11-05T16:54:10Z")

</div>

Is a highlight payload technical possible at all? I mean, could it be a  
feature request? Or will there be other solutions for problems like this  
anytime?  
Thanks

--  
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).  
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, 2:08am UTC](https://discuss.elastic.co/t/is-there-something-like-a-highlight-payload/14260/6 "2017-07-06T02:08:44Z")

</div>


