# How to display the search result with nested data

**URL:** <https://discuss.elastic.co/t/how-to-display-the-search-result-with-nested-data/348039>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [November 27, 2023, 11:55am UTC](https://discuss.elastic.co/t/how-to-display-the-search-result-with-nested-data/348039 "2023-11-27T11:55:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandhya15](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sandhya15](https://discuss.elastic.co/u/sandhya15)\
**Post date:** [November 27, 2023, 11:55am UTC](https://discuss.elastic.co/t/how-to-display-the-search-result-with-nested-data/348039/1 "2023-11-27T11:55:15Z")

</div>

Hi, I am trying to implement search screen using Search UI with Elasticsearch connector. The problem i m facing during displaying search result where the response data contains Json object.

The response from the elasticsearch is like this:

```auto
"_source": {

                    "doc": {
                        "year": 2020,
                        "num": 1234,
                      }
}

```

and in the ResultView.js code to display the year is

````auto
                        <span className="sui-result__key">Document</span>{" "}
                        <span
                            className="sui-result__value"
                            dangerouslySetInnerHTML={{
                                __html: result.doc.year.raw
                            }}
                        />
                    </li>```

Please share some tips to display the Json object returned from the response.
````

---

<div class="post-metadata">

**Author:** ![joemcelroy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joemcelroy/32/103757_2.png) [@joemcelroy](https://discuss.elastic.co/u/joemcelroy)\
**Post date:** [December 7, 2023, 8:29am UTC](https://discuss.elastic.co/t/how-to-display-the-search-result-with-nested-data/348039/2 "2023-12-07T08:29:43Z")

</div>

Hi @sandhya15

surprisingly this is a little tricky and is an outstanding bug. [Nested objects are not rendered when `elasticsearch-connector` is used · Issue #907 · elastic/search-ui · GitHub](https://github.com/elastic/search-ui/issues/907)

One way to do this is you have access to the `rawHit` within the \_meta field, which can be used in the display (when you override the itemComponent)

Joe

---

<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 4, 2024, 8:30am UTC](https://discuss.elastic.co/t/how-to-display-the-search-result-with-nested-data/348039/3 "2024-01-04T08:30:20Z")

</div>

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