# Highlighting object type field

**URL:** <https://discuss.elastic.co/t/highlighting-object-type-field/159535>\
**Category:** Elasticsearch\
**Created:** [December 5, 2018, 12:52pm UTC](https://discuss.elastic.co/t/highlighting-object-type-field/159535 "2018-12-05T12:52:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shai\_Erera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shai_erera/32/13492_2.png) [@Shai\_Erera](https://discuss.elastic.co/u/Shai_Erera)\
**Post date:** [December 5, 2018, 12:52pm UTC](https://discuss.elastic.co/t/highlighting-object-type-field/159535/1 "2018-12-05T12:52:15Z")

</div>

Is it possible to highlight an Object type field? It doesn't seem to work for me, and there's nothing in the docs that says it shouldn't work. Specifically, I index documents with sections in them, and I defined my mapping to have a `sections` field of type Object, with two sub-fields: "title" and "text". I can successfully search the fields `sections.title` and `sections.text`, they are returned in the `_source` (I also tried to explicitly store them).

When I search and request to highlight the `sections.text` field, I get no highlights at all (no even an empty response object). This is my request:

````auto
  "highlight": {
    "fragment_size": 100,
    "number_of_fragments": 3,
    "type": "unified",
    "boundary_scanner": "SENTENCE",
    "fields": {
      "sections.text": {}
    }
  }```

If I change the field to highlight on another textual field, not `Object` it works, so it definitely has to do with the Object datatype.

Is this supposed to work?
````

---

<div class="post-metadata">

**Author:** ![Shai\_Erera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shai_erera/32/13492_2.png) [@Shai\_Erera](https://discuss.elastic.co/u/Shai_Erera)\
**Post date:** [December 5, 2018, 1:08pm UTC](https://discuss.elastic.co/t/highlighting-object-type-field/159535/2 "2018-12-05T13:08:55Z")

</div>

Ugh, sorry it looks like I had a problem with my search query -- the match was found in another field than the one I wanted to highlight (and actually search on!). I fixed that and now it works.

---

<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:** [January 2, 2019, 1:08pm UTC](https://discuss.elastic.co/t/highlighting-object-type-field/159535/3 "2019-01-02T13:08:56Z")

</div>

Closed on January 2, 2019, 1:08pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
