# Finding all occurrences of a phrase or sentence

**URL:** https://discuss.elastic.co/t/finding-all-occurrences-of-a-phrase-or-sentence/121925
**Category:** Elasticsearch
**Created:** [February 28, 2018, 6:56pm UTC](https://discuss.elastic.co/t/finding-all-occurrences-of-a-phrase-or-sentence/121925 "2018-02-28T18:56:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![cpkthompson](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@cpkthompson](https://discuss.elastic.co/u/cpkthompson)
#### Post date: [February 28, 2018, 6:56pm UTC](https://discuss.elastic.co/t/finding-all-occurrences-of-a-phrase-or-sentence/121925/1 "2018-02-28T18:56:00Z")

</div>

Hello all,

I need help from a high level perspective (or a link to documentation) how I can find occurrences of a block of sentences in all documents indexed. For example: Say a specific version of the entire Bible in indexed in Elasticsearch together with about a 100 blog post writing commentary and quoting parts of this same Bible. How can I finding the linkages using Elasticsearch considering that a blog post may quote from different sections of the Bible. My guess is using a custom analyzer. Thanks

---

<div class="post-metadata">

### Author: ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)
#### Post date: [February 28, 2018, 9:35pm UTC](https://discuss.elastic.co/t/finding-all-occurrences-of-a-phrase-or-sentence/121925/2 "2018-02-28T21:35:24Z")

</div>

You probably want to do a query string search based on the text that you want to search for.

[https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html)

Highlights will tell you where in the document field the data was found  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html)

---

<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: [March 28, 2018, 9:35pm UTC](https://discuss.elastic.co/t/finding-all-occurrences-of-a-phrase-or-sentence/121925/3 "2018-03-28T21:35:28Z")

</div>

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