# Way to get summary of content

**URL:** <https://discuss.elastic.co/t/way-to-get-summary-of-content/267739>\
**Category:** Elasticsearch\
**Created:** [March 19, 2021, 2:29am UTC](https://discuss.elastic.co/t/way-to-get-summary-of-content/267739 "2021-03-19T02:29:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaru\_kim](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jaru\_kim](https://discuss.elastic.co/u/jaru_kim)\
**Post date:** [March 19, 2021, 2:29am UTC](https://discuss.elastic.co/t/way-to-get-summary-of-content/267739/1 "2021-03-19T02:29:55Z")

</div>

I am testing query for index that has documents.

```auto
    {
      "query": {
        "bool": {
          "should": [
            {
              "match": {
                "title": "test.docx"
              }
            },
            {
              "match": {
                "content": "test.docx"
              }
            }
          ]
        }
      },
      "_source": ["title", "content"], 
     "highlight": {
       "fields": {
         "content": {}
        }
      }
    }

```

Query is to search keyword in title and content.  
But, when keyword is matched only title of document, highlight is empty.  
In this case, I want to get summary of content in search result.  
for example of summary, front of 100 characters in content field.

I think that simple way is add mapping 'summary' field.  
But Is there other way in query? not to add field.

---

<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:** [April 16, 2021, 2:30am UTC](https://discuss.elastic.co/t/way-to-get-summary-of-content/267739/2 "2021-04-16T02:30:20Z")

</div>

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