# Highlighting on nested documents if include\_in\_parent is set to true?

**URL:** <https://discuss.elastic.co/t/highlighting-on-nested-documents-if-include-in-parent-is-set-to-true/8746>\
**Category:** Elasticsearch\
**Created:** [August 15, 2012, 11:23am UTC](https://discuss.elastic.co/t/highlighting-on-nested-documents-if-include-in-parent-is-set-to-true/8746 "2012-08-15T11:23:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [August 15, 2012, 11:23am UTC](https://discuss.elastic.co/t/highlighting-on-nested-documents-if-include-in-parent-is-set-to-true/8746/1 "2012-08-15T11:23:45Z")

</div>

Hi,

If I understand it correctly highlighting on nested documents is not  
possible if nested query is used. Even if include\_in\_parent/root is  
enabled. Would it be possible to implement on the ES side such feature that  
if include\_in\_parent/root is enabled and nested query is used then  
highlighting on nested document fields would work out of the box? Can not  
ES just use nested query to highlight on nested fields that are present in  
parent?

My naive understanding is that this should be possible (ES has all the  
information during execution of the query), no?

Shall I open a ticket?

Regards,  
Lukas

--

---

<div class="post-metadata">

**Author:** ![haizaar](https://avatars.discourse-cdn.com/v4/letter/h/3d9bf3/32.png) [@haizaar](https://discuss.elastic.co/u/haizaar)\
**Post date:** [November 17, 2012, 10:08pm UTC](https://discuss.elastic.co/t/highlighting-on-nested-documents-if-include-in-parent-is-set-to-true/8746/2 "2012-11-17T22:08:26Z")

</div>

+1 for this.

On Wednesday, August 15, 2012 2:23:45 PM UTC+3, Lukáš Vlček wrote:

> Hi,
> 
> If I understand it correctly highlighting on nested documents is not  
> possible if nested query is used. Even if include\_in\_parent/root is  
> enabled. Would it be possible to implement on the ES side such feature that  
> if include\_in\_parent/root is enabled and nested query is used then  
> highlighting on nested document fields would work out of the box? Can not  
> ES just use nested query to highlight on nested fields that are present in  
> parent?
> 
> My naive understanding is that this should be possible (ES has all the  
> information during execution of the query), no?
> 
> Shall I open a ticket?
> 
> Regards,  
> Lukas

--

---

<div class="post-metadata">

**Author:** ![vineeth\_mohan](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vineeth\_mohan](https://discuss.elastic.co/u/vineeth_mohan)\
**Post date:** [November 18, 2012, 10:46am UTC](https://discuss.elastic.co/t/highlighting-on-nested-documents-if-include-in-parent-is-set-to-true/8746/3 "2012-11-18T10:46:53Z")

</div>

I have also talked this the same to Shay on several occasions.

His explanation was that this would take a good amount of memory as there  
can be a large number of children.  
And it looks genuine to me as adding this feature will violate the basic  
concept of processing only N number of feeds at a time.  
Instead say a parent have 10,000 children , though we are dealing with 10  
parent (assuming size is 10) at a time , in reality we would be dealing  
with processing one lakh document at a time.

Searching wont be a problem as it only deals with the index and not the  
actual stored feed.

Thanks  
Vineeth

On Sun, Nov 18, 2012 at 3:38 AM, Zaar Hai [haizaar@gmail.com](mailto:haizaar@gmail.com) wrote:

> +1 for this.
> 
> On Wednesday, August 15, 2012 2:23:45 PM UTC+3, Lukáš Vlček wrote:
> 
> > Hi,
> > 
> > If I understand it correctly highlighting on nested documents is not  
> > possible if nested query is used. Even if include\_in\_parent/root is  
> > enabled. Would it be possible to implement on the ES side such feature that  
> > if include\_in\_parent/root is enabled and nested query is used then  
> > highlighting on nested document fields would work out of the box? Can not  
> > ES just use nested query to highlight on nested fields that are present in  
> > parent?
> > 
> > My naive understanding is that this should be possible (ES has all the  
> > information during execution of the query), no?
> > 
> > Shall I open a ticket?
> > 
> > Regards,  
> > Lukas
> > 
> > --

--

---

<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, 3:03am UTC](https://discuss.elastic.co/t/highlighting-on-nested-documents-if-include-in-parent-is-set-to-true/8746/4 "2017-07-06T03:03:49Z")

</div>


