# Summarizing html content in search results

**URL:** <https://discuss.elastic.co/t/summarizing-html-content-in-search-results/366880>\
**Category:** Elasticsearch\
**Created:** [September 20, 2024, 1:43pm UTC](https://discuss.elastic.co/t/summarizing-html-content-in-search-results/366880 "2024-09-20T13:43:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hiru\_Fernando](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hiru_fernando/32/137764_2.png) [@Hiru\_Fernando](https://discuss.elastic.co/u/Hiru_Fernando)\
**Post date:** [September 20, 2024, 1:43pm UTC](https://discuss.elastic.co/t/summarizing-html-content-in-search-results/366880/1 "2024-09-20T13:43:58Z")

</div>

Hello team,

We have created an instance of Elasticsearch and have created an index configuration that will return the fields we need on search.  
However, one feature we want is a summary of the html content so we can display it along with each search result.

The summary should highlight the query the user searched for.  
I have seen that there is something called `meta_description` which seems to be what we want, however, our html pages do not have the `<meta name="description">` tag Elasticsearch is looking for to populate this field.

Is there any other way we can get a summary? maybe we are missing some sort of other configuration?

Thank you!

---

<div class="post-metadata">

**Author:** ![jessgarson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jessgarson/32/129841_2.png) [@jessgarson](https://discuss.elastic.co/u/jessgarson)\
**Post date:** [September 24, 2024, 7:40pm UTC](https://discuss.elastic.co/t/summarizing-html-content-in-search-results/366880/2 "2024-09-24T19:40:17Z")

</div>

Thanks for reaching out, @Hiru_Fernando. I'm interested in learning some more context about the summary you are looking for. What does the output look like? Also what version of Elasticsearch are you using?

---

<div class="post-metadata">

**Author:** ![Hiru\_Fernando](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hiru_fernando/32/137764_2.png) [@Hiru\_Fernando](https://discuss.elastic.co/u/Hiru_Fernando)\
**Post date:** [September 25, 2024, 5:34pm UTC](https://discuss.elastic.co/t/summarizing-html-content-in-search-results/366880/3 "2024-09-25T17:34:17Z")

</div>

Hi Jess!  
So actually I was able to use the following to get snippets of HTML body content.

```auto
          body_content: {
            raw: {},
            snippet: {
              size: 100,
              fallback: true,
            },
          },

```

with this I can get back snippets that are found within the content/body content that basically highlights the query I searched for.

---

<div class="post-metadata">

**Author:** ![jessgarson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jessgarson/32/129841_2.png) [@jessgarson](https://discuss.elastic.co/u/jessgarson)\
**Post date:** [September 25, 2024, 6:01pm UTC](https://discuss.elastic.co/t/summarizing-html-content-in-search-results/366880/4 "2024-09-25T18:01:51Z")

</div>

Oh awesome, @Hiru_Fernando! Thanks for sharing your solution!
