# Top level inner hits highlighting

**URL:** <https://discuss.elastic.co/t/top-level-inner-hits-highlighting/40980>\
**Category:** Elasticsearch\
**Created:** [February 4, 2016, 4:41pm UTC](https://discuss.elastic.co/t/top-level-inner-hits-highlighting/40980 "2016-02-04T16:41:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benjamin\_Gathmann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benjamin_gathmann/32/7561_2.png) [@Benjamin\_Gathmann](https://discuss.elastic.co/u/Benjamin_Gathmann)\
**Post date:** [February 4, 2016, 4:41pm UTC](https://discuss.elastic.co/t/top-level-inner-hits-highlighting/40980/1 "2016-02-04T16:41:16Z")

</div>

Hi there,

I use multiple nesting and have tried highlighting my results, but the highlighting is only returned for the innermost nest.  
Here is a simplified query string (only the inner\_hits part):

```
"inner_hits" : {
        "kids" : {
            "path" : {
                "first" : {
                    "query" : {
                        "match" : {
                            "first.a" : 123
                        }
                    },
                    "_source" : false,
                    "highlight" : {
                        "fields" : {
                            "first.a" : {}

                        }
                    },
                    "fielddata_fields" : ["first.b","first.c"],
                    "inner_hits" : {
                        "kids" : {
                            "path" : {
                                "first.second" : {
                                    "query" : {
                                        "bool" : {
                                            "filter" : {
                                                    "term" : {
                                                        "first.second.a" : "abc"
                                                    }
                                                }
                                        }
                                    },
                                    "_source" : false,
                                    "highlight" : {
                                        "fields" : {
                                                "first.second.a" : {}

                                            }
                                    },
                                    "fielddata_fields" : ["first.second.b","first.second.c"]
                                }
                            }
                        }
                    }
                }
            }
        }
    }

```

This returns a "highlight" object for "first.second", but not for "first".

Is it a bug or a feature?

---

<div class="post-metadata">

**Author:** ![Benjamin\_Gathmann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benjamin_gathmann/32/7561_2.png) [@Benjamin\_Gathmann](https://discuss.elastic.co/u/Benjamin_Gathmann)\
**Post date:** [February 5, 2016, 9:20am UTC](https://discuss.elastic.co/t/top-level-inner-hits-highlighting/40980/2 "2016-02-05T09:20:33Z")

</div>

Hey, I just realized that highlighting only works (and makes sense) for string fields. So if I ask for highlighting on a long field as in my example, I won't get anything back. 🙂

---

<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 5, 2017, 11:18pm UTC](https://discuss.elastic.co/t/top-level-inner-hits-highlighting/40980/3 "2017-07-05T23:18:39Z")

</div>


