# Can I limit displayed search results to applicable sentences or paragraphs rather than entire document?

**URL:** https://discuss.elastic.co/t/can-i-limit-displayed-search-results-to-applicable-sentences-or-paragraphs-rather-than-entire-document/286166
**Category:** Elasticsearch
**Created:** [October 7, 2021, 11:15pm UTC](https://discuss.elastic.co/t/can-i-limit-displayed-search-results-to-applicable-sentences-or-paragraphs-rather-than-entire-document/286166 "2021-10-07T23:15:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![neergttocsdivad](https://avatars.discourse-cdn.com/v4/letter/n/43a26b/32.png) [@neergttocsdivad](https://discuss.elastic.co/u/neergttocsdivad)
#### Post date: [October 7, 2021, 11:15pm UTC](https://discuss.elastic.co/t/can-i-limit-displayed-search-results-to-applicable-sentences-or-paragraphs-rather-than-entire-document/286166/1 "2021-10-07T23:15:02Z")

</div>

I have indexed 24 Jack Reacher books.  
Any successful search displays at least one book in its entirety.  
e.g.:

```auto
}
GET books4/_search
{
  "query": {
    "match_phrase":{
    "content": "deerfield nodded"
    }
  }
}

```

Is there a way of requesting just the containing sentences, like with n-grams?

---

<div class="post-metadata">

### Author: ![neergttocsdivad](https://avatars.discourse-cdn.com/v4/letter/n/43a26b/32.png) [@neergttocsdivad](https://discuss.elastic.co/u/neergttocsdivad)
#### Post date: [October 8, 2021, 5:05am UTC](https://discuss.elastic.co/t/can-i-limit-displayed-search-results-to-applicable-sentences-or-paragraphs-rather-than-entire-document/286166/2 "2021-10-08T05:05:09Z")

</div>

Is it highlighting? Fragments?

> **[Highlighting | Elasticsearch Guide \[7.15\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.15/highlighting.html)**

Tried this (modified from an example at the bottom of the 'Highlights'page) but it didn't work, or at least not the way I expected, as the result still contained all the text.

```auto
GET books4/_search
{
  "query": {
    "match_phrase" : {"content" : "deerfield nodded"}
  },
  "highlight": {
    "type" : "unified",
    "number_of_fragments" : 3,
    "fields": {
      "content": {}
    }
  }
}

```

---

<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: [November 5, 2021, 5:05am UTC](https://discuss.elastic.co/t/can-i-limit-displayed-search-results-to-applicable-sentences-or-paragraphs-rather-than-entire-document/286166/3 "2021-11-05T05:05:28Z")

</div>

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