# Search similar words in a big text

**URL:** <https://discuss.elastic.co/t/search-similar-words-in-a-big-text/18546>\
**Category:** Elasticsearch\
**Created:** [July 9, 2014, 7:10am UTC](https://discuss.elastic.co/t/search-similar-words-in-a-big-text/18546 "2014-07-09T07:10:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorge\_von\_Rudno](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Jorge\_von\_Rudno](https://discuss.elastic.co/u/Jorge_von_Rudno)\
**Post date:** [July 9, 2014, 7:10am UTC](https://discuss.elastic.co/t/search-similar-words-in-a-big-text/18546/1 "2014-07-09T07:10:27Z")

</div>

Hi everybody!!!

first of all I want to comment that at the moment I am a beginner in  
elasticsearch. so, I have the following situation and I don't know if it is  
possible to solve with elasticsearch.

I have a Index that contains for every document the content of a web page.  
I want to develop a query where I give a text and it return the part of the  
field that contains the text. Perhaps with one example I can explain me  
better.

document 1:  
field\_Id: 1  
content : "This is one example to search a _text_ in a long string"

document 2:  
field\_id: 2  
content : "The second example help us to _texting_ the function to search"

If I send the word "tex" I will expect to have the return: "text",  
"texting".

Please tell me if elasticsearch is as powerful that can solve this or if I  
have to implement an algorithm to solve it.

In advance thanks a lot.

Regards

Jorge von Rudno

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/571daeee-5889-4a01-8ce8-3f3fc91eee92%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/571daeee-5889-4a01-8ce8-3f3fc91eee92%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![vineeth\_mohan\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_mohan_2/32/747_2.png) [@vineeth\_mohan\_2](https://discuss.elastic.co/u/vineeth_mohan_2)\
**Post date:** [July 9, 2014, 7:26am UTC](https://discuss.elastic.co/t/search-similar-words-in-a-big-text/18546/2 "2014-07-09T07:26:54Z")

</div>

Hello Jorge ,

Here please expand your requirement specifications.  
There are couple of things out there which will help you

1. Stemmers - It will convert all words like "Run , running , ran" -\>  
into its baseform . That is run. ES has support for snowball and porterstem  
stemmers -  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-snowball-tokenfilter.html#analysis-snowball-tokenfilter)
2. Find similar words like spell check and all using fuzzy query -  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html#query-dsl-fuzzy-query)
3. Find words which will look similar when pronounced - Like cool and  
kool. Phonetic tokenizer -  
[GitHub - elastic/elasticsearch-analysis-phonetic: Phonetic Analysis Plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-analysis-phonetic)
4. And the last one , the particular example you have quoted , i believe  
you need to use shingle or NGram (  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-shingle-tokenfilter.html#analysis-shingle-tokenfilter)  
,  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-ngram-tokenfilter.html)  
)

Thanks  
Vineeth

On Wed, Jul 9, 2014 at 12:40 PM, Jorge von Rudno \<  
[jorge.vonrudno.gp@googlemail.com](mailto:jorge.vonrudno.gp@googlemail.com)\> wrote:

> Hi everybody!!!
> 
> first of all I want to comment that at the moment I am a beginner in  
> elasticsearch. so, I have the following situation and I don't know if it is  
> possible to solve with elasticsearch.
> 
> I have a Index that contains for every document the content of a web page.  
> I want to develop a query where I give a text and it return the part of the  
> field that contains the text. Perhaps with one example I can explain me  
> better.
> 
> document 1:  
> field\_Id: 1  
> content : "This is one example to search a _text_ in a long string"
> 
> document 2:  
> field\_id: 2  
> content : "The second example help us to _texting_ the function to search"
> 
> If I send the word "tex" I will expect to have the return: "text",  
> "texting".
> 
> Please tell me if elasticsearch is as powerful that can solve this or if I  
> have to implement an algorithm to solve it.
> 
> In advance thanks a lot.
> 
> Regards
> 
> Jorge von Rudno
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/571daeee-5889-4a01-8ce8-3f3fc91eee92%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/571daeee-5889-4a01-8ce8-3f3fc91eee92%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/571daeee-5889-4a01-8ce8-3f3fc91eee92%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/571daeee-5889-4a01-8ce8-3f3fc91eee92%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGdPd5kEDV9bJbEqcjaQP-UDNF0VYPQT68YH%2BkPzG7V0ox6Lcw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5kEDV9bJbEqcjaQP-UDNF0VYPQT68YH%2BkPzG7V0ox6Lcw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Jorge\_von\_Rudno](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Jorge\_von\_Rudno](https://discuss.elastic.co/u/Jorge_von_Rudno)\
**Post date:** [July 9, 2014, 8:36am UTC](https://discuss.elastic.co/t/search-similar-words-in-a-big-text/18546/3 "2014-07-09T08:36:14Z")

</div>

On 07/09/2014 09:26 AM, vineeth mohan wrote:

> Hello Jorge ,
> 
> Here please expand your requirement specifications.  
> There are couple of things out there which will help you
> 
> 1. Stemmers - It will convert all words like "Run , running , ran" -\>  
> into its baseform . That is run. ES has support for snowball and  
> porterstem stemmers
> - [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-snowball-tokenfilter.html#analysis-snowball-tokenfilter)
> 
> 2. Find similar words like spell check and all using fuzzy query
> - [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html#query-dsl-fuzzy-query)
> 
> 3. Find words which will look similar when pronounced - Like cool and  
> kool. Phonetic tokenizer
> - [GitHub - elastic/elasticsearch-analysis-phonetic: Phonetic Analysis Plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-analysis-phonetic)
> 
> 4. And the last one , the particular example you have quoted , i  
> believe you need to use shingle or NGram  
> ([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-shingle-tokenfilter.html#analysis-shingle-tokenfilter)  
> , [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-ngram-tokenfilter.html))
> 
> Thanks  
> Vineeth
> 
> On Wed, Jul 9, 2014 at 12:40 PM, Jorge von Rudno  
> \<[jorge.vonrudno.gp@googlemail.com](mailto:jorge.vonrudno.gp@googlemail.com)  
> [mailto:jorge.vonrudno.gp@googlemail.com](mailto:jorge.vonrudno.gp@googlemail.com)\> wrote:
> 
> ```
> Hi everybody!!!
> 
> first of all I want to comment that at the moment I am a beginner
> in elasticsearch. so, I have the following situation and I don't
> know if it is possible to solve with elasticsearch.
> 
> I have a Index that contains for every document the content of a
> web page. I want to develop a query where I give a text and it
> return the part of the field that contains the text. Perhaps with
> one example I can explain me better.
> 
> document 1:
> field_Id: 1
> content : "This is one example to search a _*text*_ in a long string"
> 
> document 2:
> field_id: 2
> content : "The second example help us to _*texting*_ the function
> to search"
> 
> If I send the word "tex" I will expect to have the return: "text",
> "texting".
> 
> Please tell me if elasticsearch is as powerful that can solve this
> or if I have to implement an algorithm to solve it.
> 
> In advance thanks a lot.
> 
> Regards
> 
> Jorge von Rudno
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "elasticsearch" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to elasticsearch+unsubscribe@googlegroups.com
> <mailto:elasticsearch+unsubscribe@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/571daeee-5889-4a01-8ce8-3f3fc91eee92%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/571daeee-5889-4a01-8ce8-3f3fc91eee92%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.
> 
> ```
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/jraNffR8iAA/unsubscribe](https://groups.google.com/d/topic/elasticsearch/jraNffR8iAA/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com)  
> [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAGdPd5kEDV9bJbEqcjaQP-UDNF0VYPQT68YH%2BkPzG7V0ox6Lcw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5kEDV9bJbEqcjaQP-UDNF0VYPQT68YH%2BkPzG7V0ox6Lcw%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAGdPd5kEDV9bJbEqcjaQP-UDNF0VYPQT68YH%2BkPzG7V0ox6Lcw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5kEDV9bJbEqcjaQP-UDNF0VYPQT68YH%2BkPzG7V0ox6Lcw%40mail.gmail.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

hello Vieeeth, thanks a lot for your great support, I will work with  
your suggestions and I will tell you about the result.

Best regards

Jorge von Rudno

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/53BCFEFE.2000708%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/53BCFEFE.2000708%40gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 1:17am UTC](https://discuss.elastic.co/t/search-similar-words-in-a-big-text/18546/4 "2017-07-06T01:17:04Z")

</div>


