# Elastic Search for misspelled words

**URL:** <https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074>\
**Category:** Elasticsearch\
**Created:** [October 23, 2013, 3:09pm UTC](https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074 "2013-10-23T15:09:06Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![samir\_selia](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@samir\_selia](https://discuss.elastic.co/u/samir_selia)\
**Post date:** [October 23, 2013, 3:09pm UTC](https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074/1 "2013-10-23T15:09:06Z")

</div>

Dear All,

I want to display best possible results for misspelled search terms

I tried using fuzzy method. It works well for search term having single  
word. For multiple words it doesn't return any result.

Below is the sample code.

$result = $es-\>search(array(  
'query' =\> array(  
"fuzzy" =\> array(  
"name" =\> array(  
"value" =\> "jay z",  
"boost" =\> 1.0,  
"min\_similarity" =\> 0.5,  
"prefix\_length" =\> 1  
)  
)  
),  
"from" =\> $start,  
"size" =\> $limit  
)  
);

Thanks,  
Samir

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [October 23, 2013, 10:27pm UTC](https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074/2 "2013-10-23T22:27:13Z")

</div>

For phrase queries, try using a match query with fuzziness enabled. It will  
create a fuzzy query for each term in your search.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Cheers,

Ivan

On Wed, Oct 23, 2013 at 8:09 AM, [samir.selia@wcities.com](mailto:samir.selia@wcities.com) wrote:

> Dear All,
> 
> I want to display best possible results for misspelled search terms
> 
> I tried using fuzzy method. It works well for search term having single  
> word. For multiple words it doesn't return any result.
> 
> Below is the sample code.
> 
> $result = $es-\>search(array(  
> 'query' =\> array(  
> "fuzzy" =\> array(  
> "name" =\> array(  
> "value" =\> "jay z",  
> "boost" =\> 1.0,  
> "min\_similarity" =\> 0.5,  
> "prefix\_length" =\> 1  
> )  
> )  
> ),  
> "from" =\> $start,  
> "size" =\> $limit  
> )  
> );
> 
> Thanks,  
> Samir
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![samir\_selia](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@samir\_selia](https://discuss.elastic.co/u/samir_selia)\
**Post date:** [October 24, 2013, 5:30am UTC](https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074/3 "2013-10-24T05:30:17Z")

</div>

Hi Ivan,

Thank you for your reply.

I tried match query. For single word fuzzy method returns more appropriate  
results.  
Is there any way to combine match and fuzzy in single query or other method  
to get best possible results for single and multiple words?

Below is match query sample:

$result = $es-\>search(array(  
'query' =\> array(  
'match' =\> array(  
'name' =\> array(  
"query" =\> 'rihna',  
"operator" =\> "or",  
"fuzziness" =\> 1.0,  
"prefix\_length" =\> 1  
)  
)

```
            )
        )
    );

```

On Thursday, October 24, 2013 3:57:13 AM UTC+5:30, Ivan Brusic wrote:

> For phrase queries, try using a match query with fuzziness enabled. It  
> will create a fuzzy query for each term in your search.
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-match-query.html)
> 
> Cheers,
> 
> Ivan
> 
> On Wed, Oct 23, 2013 at 8:09 AM, \<[samir...@wcities.com](mailto:samir...@wcities.com) \<javascript:\>\>wrote:
> 
> > Dear All,
> > 
> > I want to display best possible results for misspelled search terms
> > 
> > I tried using fuzzy method. It works well for search term having single  
> > word. For multiple words it doesn't return any result.
> > 
> > Below is the sample code.
> > 
> > $result = $es-\>search(array(  
> > 'query' =\> array(  
> > "fuzzy" =\> array(  
> > "name" =\> array(  
> > "value" =\> "jay z",  
> > "boost" =\> 1.0,  
> > "min\_similarity" =\> 0.5,  
> > "prefix\_length" =\> 1  
> > )  
> > )  
> > ),  
> > "from" =\> $start,  
> > "size" =\> $limit  
> > )  
> > );
> > 
> > Thanks,  
> > Samir
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Hendrik](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@Hendrik](https://discuss.elastic.co/u/Hendrik)\
**Post date:** [October 24, 2013, 5:40am UTC](https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074/4 "2013-10-24T05:40:41Z")

</div>

maybe a phonetic search is the right for  
you [GitHub - elastic/elasticsearch-analysis-phonetic: Phonetic Analysis Plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-analysis-phonetic)

Am Mittwoch, 23. Oktober 2013 17:09:06 UTC+2 schrieb [samir...@wcities.com](mailto:samir...@wcities.com):

> Dear All,
> 
> I want to display best possible results for misspelled search terms
> 
> I tried using fuzzy method. It works well for search term having single  
> word. For multiple words it doesn't return any result.
> 
> Below is the sample code.
> 
> $result = $es-\>search(array(  
> 'query' =\> array(  
> "fuzzy" =\> array(  
> "name" =\> array(  
> "value" =\> "jay z",  
> "boost" =\> 1.0,  
> "min\_similarity" =\> 0.5,  
> "prefix\_length" =\> 1  
> )  
> )  
> ),  
> "from" =\> $start,  
> "size" =\> $limit  
> )  
> );
> 
> Thanks,  
> Samir

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![samir\_selia](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@samir\_selia](https://discuss.elastic.co/u/samir_selia)\
**Post date:** [October 24, 2013, 6:39am UTC](https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074/5 "2013-10-24T06:39:16Z")

</div>

Hi Hendrik,

Thank you for your reply.

Phonetic search is in java.  
I am looking for a PHP library.

On Thursday, October 24, 2013 11:10:41 AM UTC+5:30, Hendrik wrote:

> maybe a phonetic search is the right for you  
> [GitHub - elastic/elasticsearch-analysis-phonetic: Phonetic Analysis Plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-analysis-phonetic)
> 
> Am Mittwoch, 23. Oktober 2013 17:09:06 UTC+2 schrieb [samir...@wcities.com](mailto:samir...@wcities.com):
> 
> > Dear All,
> > 
> > I want to display best possible results for misspelled search terms
> > 
> > I tried using fuzzy method. It works well for search term having single  
> > word. For multiple words it doesn't return any result.
> > 
> > Below is the sample code.
> > 
> > $result = $es-\>search(array(  
> > 'query' =\> array(  
> > "fuzzy" =\> array(  
> > "name" =\> array(  
> > "value" =\> "jay z",  
> > "boost" =\> 1.0,  
> > "min\_similarity" =\> 0.5,  
> > "prefix\_length" =\> 1  
> > )  
> > )  
> > ),  
> > "from" =\> $start,  
> > "size" =\> $limit  
> > )  
> > );
> > 
> > Thanks,  
> > Samir

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![sina\_tamanna](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@sina\_tamanna](https://discuss.elastic.co/u/sina_tamanna)\
**Post date:** [October 24, 2013, 7:13am UTC](https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074/6 "2013-10-24T07:13:15Z")

</div>

Phonetic search is a plugin. You can install it and the syntax will be  
available in PHP or any other language. It is written in java, but that  
doesn't limit its usage to java.

On Thursday, October 24, 2013 8:39:16 AM UTC+2, [samir...@wcities.com](mailto:samir...@wcities.com) wrote:

> Hi Hendrik,
> 
> Thank you for your reply.
> 
> Phonetic search is in java.  
> I am looking for a PHP library.
> 
> On Thursday, October 24, 2013 11:10:41 AM UTC+5:30, Hendrik wrote:
> 
> > maybe a phonetic search is the right for you  
> > [GitHub - elastic/elasticsearch-analysis-phonetic: Phonetic Analysis Plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-analysis-phonetic)
> > 
> > Am Mittwoch, 23. Oktober 2013 17:09:06 UTC+2 schrieb [samir...@wcities.com](mailto:samir...@wcities.com)  
> > :
> > 
> > > Dear All,
> > > 
> > > I want to display best possible results for misspelled search terms
> > > 
> > > I tried using fuzzy method. It works well for search term having single  
> > > word. For multiple words it doesn't return any result.
> > > 
> > > Below is the sample code.
> > > 
> > > $result = $es-\>search(array(  
> > > 'query' =\> array(  
> > > "fuzzy" =\> array(  
> > > "name" =\> array(  
> > > "value" =\> "jay z",  
> > > "boost" =\> 1.0,  
> > > "min\_similarity" =\> 0.5,  
> > > "prefix\_length" =\> 1  
> > > )  
> > > )  
> > > ),  
> > > "from" =\> $start,  
> > > "size" =\> $limit  
> > > )  
> > > );
> > > 
> > > Thanks,  
> > > Samir

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [October 24, 2013, 1:03pm UTC](https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074/7 "2013-10-24T13:03:03Z")

</div>

I know this is t what you were looking for but I have to make sure you are aware that the phrase suggester does a really good job of finding misspellings. It'll even find misspelled phrases made I properly spelled words. It has it's caveats but might be worth looking into.  
Sent from my iPhone

> On Oct 24, 2013, at 3:13 AM, [sina.tamanna@gmail.com](mailto:sina.tamanna@gmail.com) wrote:
> 
> Phonetic search is a plugin. You can install it and the syntax will be available in PHP or any other language. It is written in java, but that doesn't limit its usage to java.
> 
> > On Thursday, October 24, 2013 8:39:16 AM UTC+2, [samir...@wcities.com](mailto:samir...@wcities.com) wrote:  
> > Hi Hendrik,
> > 
> > Thank you for your reply.
> > 
> > Phonetic search is in java.  
> > I am looking for a PHP library.
> > 
> > > On Thursday, October 24, 2013 11:10:41 AM UTC+5:30, Hendrik wrote:  
> > > maybe a phonetic search is the right for you [GitHub - elastic/elasticsearch-analysis-phonetic: Phonetic Analysis Plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-analysis-phonetic)
> > > 
> > > Am Mittwoch, 23. Oktober 2013 17:09:06 UTC+2 schrieb [samir...@wcities.com](mailto:samir...@wcities.com):
> > > 
> > > > Dear All,
> > > > 
> > > > I want to display best possible results for misspelled search terms
> > > > 
> > > > I tried using fuzzy method. It works well for search term having single word. For multiple words it doesn't return any result.
> > > > 
> > > > Below is the sample code.
> > > > 
> > > > $result = $es-\>search(array(  
> > > > 'query' =\> array(  
> > > > "fuzzy" =\> array(  
> > > > "name" =\> array(  
> > > > "value" =\> "jay z",  
> > > > "boost" =\> 1.0,  
> > > > "min\_similarity" =\> 0.5,  
> > > > "prefix\_length" =\> 1  
> > > > )  
> > > > )  
> > > > ),  
> > > > "from" =\> $start,  
> > > > "size" =\> $limit  
> > > > )  
> > > > );
> > > > 
> > > > Thanks,  
> > > > Samir
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![samir\_selia](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@samir\_selia](https://discuss.elastic.co/u/samir_selia)\
**Post date:** [October 30, 2013, 5:06am UTC](https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074/8 "2013-10-30T05:06:47Z")

</div>

Thank you all for your suggestions.

Phonetic search worked for me.

But it doesn't return any results for unicode characters.  
For e.g.  
There is an artist named "Beyoncé" with unicode character é.  
For search term Beyoncé (with unicode character) it returns proper results.  
But for Beyonce (without unicode character) it returns no results.

Any suggestions will be highly appreciated.

On Thursday, October 24, 2013 6:33:03 PM UTC+5:30, Nikolas Everett wrote:

> I know this is t what you were looking for but I have to make sure you are  
> aware that the phrase suggester does a really good job of finding  
> misspellings. It'll even find misspelled phrases made I properly spelled  
> words. It has it's caveats but might be worth looking into.  
> Sent from my iPhone
> 
> On Oct 24, 2013, at 3:13 AM, [sina.t...@gmail.com](mailto:sina.t...@gmail.com) \<javascript:\> wrote:
> 
> Phonetic search is a plugin. You can install it and the syntax will be  
> available in PHP or any other language. It is written in java, but that  
> doesn't limit its usage to java.
> 
> On Thursday, October 24, 2013 8:39:16 AM UTC+2, samir...@wcities.comwrote:
> 
> > Hi Hendrik,
> > 
> > Thank you for your reply.
> > 
> > Phonetic search is in java.  
> > I am looking for a PHP library.
> > 
> > On Thursday, October 24, 2013 11:10:41 AM UTC+5:30, Hendrik wrote:
> > 
> > > maybe a phonetic search is the right for you  
> > > [GitHub - elastic/elasticsearch-analysis-phonetic: Phonetic Analysis Plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-analysis-phonetic)
> > > 
> > > Am Mittwoch, 23. Oktober 2013 17:09:06 UTC+2 schrieb  
> > > [samir...@wcities.com](mailto:samir...@wcities.com):
> > > 
> > > > Dear All,
> > > > 
> > > > I want to display best possible results for misspelled search terms
> > > > 
> > > > I tried using fuzzy method. It works well for search term having single  
> > > > word. For multiple words it doesn't return any result.
> > > > 
> > > > Below is the sample code.
> > > > 
> > > > $result = $es-\>search(array(  
> > > > 'query' =\> array(  
> > > > "fuzzy" =\> array(  
> > > > "name" =\> array(  
> > > > "value" =\> "jay z",  
> > > > "boost" =\> 1.0,  
> > > > "min\_similarity" =\> 0.5,  
> > > > "prefix\_length" =\> 1  
> > > > )  
> > > > )  
> > > > ),  
> > > > "from" =\> $start,  
> > > > "size" =\> $limit  
> > > > )  
> > > > );
> > > > 
> > > > Thanks,  
> > > > Samir
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 30, 2013, 5:28am UTC](https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074/9 "2013-10-30T05:28:04Z")

</div>

Did you try to apply an asciifolding filter as well?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 30 oct. 2013 à 06:06, [samir.selia@wcities.com](mailto:samir.selia@wcities.com) a écrit :

Thank you all for your suggestions.

Phonetic search worked for me.

But it doesn't return any results for unicode characters.  
For e.g.  
There is an artist named "Beyoncé" with unicode character é.  
For search term Beyoncé (with unicode character) it returns proper results. But for Beyonce (without unicode character) it returns no results.

Any suggestions will be highly appreciated.

> On Thursday, October 24, 2013 6:33:03 PM UTC+5:30, Nikolas Everett wrote:
> 
> I know this is t what you were looking for but I have to make sure you are aware that the phrase suggester does a really good job of finding misspellings. It'll even find misspelled phrases made I properly spelled words. It has it's caveats but might be worth looking into.  
> Sent from my iPhone
> 
> > On Oct 24, 2013, at 3:13 AM, [sina.t...@gmail.com](mailto:sina.t...@gmail.com) wrote:
> > 
> > Phonetic search is a plugin. You can install it and the syntax will be available in PHP or any other language. It is written in java, but that doesn't limit its usage to java.
> > 
> > > On Thursday, October 24, 2013 8:39:16 AM UTC+2, [samir...@wcities.com](mailto:samir...@wcities.com) wrote:  
> > > Hi Hendrik,
> > > 
> > > Thank you for your reply.
> > > 
> > > Phonetic search is in java.  
> > > I am looking for a PHP library.
> > > 
> > > > On Thursday, October 24, 2013 11:10:41 AM UTC+5:30, Hendrik wrote:  
> > > > maybe a phonetic search is the right for you [GitHub - elastic/elasticsearch-analysis-phonetic: Phonetic Analysis Plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-analysis-phonetic)
> > > > 
> > > > Am Mittwoch, 23. Oktober 2013 17:09:06 UTC+2 schrieb [samir...@wcities.com](mailto:samir...@wcities.com):
> > > > 
> > > > > Dear All,
> > > > > 
> > > > > I want to display best possible results for misspelled search terms
> > > > > 
> > > > > I tried using fuzzy method. It works well for search term having single word. For multiple words it doesn't return any result.
> > > > > 
> > > > > Below is the sample code.
> > > > > 
> > > > > $result = $es-\>search(array(  
> > > > > 'query' =\> array(  
> > > > > "fuzzy" =\> array(  
> > > > > "name" =\> array(  
> > > > > "value" =\> "jay z",  
> > > > > "boost" =\> 1.0,  
> > > > > "min\_similarity" =\> 0.5,  
> > > > > "prefix\_length" =\> 1  
> > > > > )  
> > > > > )  
> > > > > ),  
> > > > > "from" =\> $start,  
> > > > > "size" =\> $limit  
> > > > > )  
> > > > > );
> > > > > 
> > > > > Thanks,  
> > > > > Samir
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [October 30, 2013, 8:07am UTC](https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074/10 "2013-10-30T08:07:44Z")

</div>

Of you use Unicode, you should use ICU folding, which is far more powerful  
than ASCII folding

> **[elastic/elasticsearch-analysis-icu](https://github.com/elastic/elasticsearch-analysis-icu)**
>
> elasticsearch-analysis-icu - ICU Analysis plugin for Elasticsearch

Jörg

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![vallabh\_2](https://avatars.discourse-cdn.com/v4/letter/v/7ab992/32.png) [@vallabh\_2](https://discuss.elastic.co/u/vallabh_2)\
**Post date:** [October 31, 2013, 10:26am UTC](https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074/11 "2013-10-31T10:26:50Z")

</div>

Thanks for your suggestions,

asciifolding works for me for unicode character.

But it doesnot works for special character.

for e.g,  
There is an artist name !!! (chk chk chk) with three exclamation mark.  
when i search chk, then it gives the result, but when i search only !!!  
(three exclamation mark) then it gives nothing.

Also there is an artist, ke$ha (having $ in it)  
I wanted to search by kesha (without $)

Any suggestions will be appreciated.

On Wednesday, October 30, 2013 10:58:04 AM UTC+5:30, David Pilato wrote:

> Did you try to apply an asciifolding filter as well?
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 30 oct. 2013 à 06:06, [samir...@wcities.com](mailto:samir...@wcities.com) \<javascript:\> a écrit :
> 
> Thank you all for your suggestions.
> 
> Phonetic search worked for me.
> 
> But it doesn't return any results for unicode characters.  
> For e.g.  
> There is an artist named "Beyoncé" with unicode character é.  
> For search term Beyoncé (with unicode character) it returns proper  
> results. But for Beyonce (without unicode character) it returns no results.
> 
> Any suggestions will be highly appreciated.
> 
> On Thursday, October 24, 2013 6:33:03 PM UTC+5:30, Nikolas Everett wrote:
> 
> > I know this is t what you were looking for but I have to make sure you  
> > are aware that the phrase suggester does a really good job of finding  
> > misspellings. It'll even find misspelled phrases made I properly spelled  
> > words. It has it's caveats but might be worth looking into.  
> > Sent from my iPhone
> > 
> > On Oct 24, 2013, at 3:13 AM, [sina.t...@gmail.com](mailto:sina.t...@gmail.com) wrote:
> > 
> > Phonetic search is a plugin. You can install it and the syntax will be  
> > available in PHP or any other language. It is written in java, but that  
> > doesn't limit its usage to java.
> > 
> > On Thursday, October 24, 2013 8:39:16 AM UTC+2, samir...@wcities.comwrote:
> > 
> > > Hi Hendrik,
> > > 
> > > Thank you for your reply.
> > > 
> > > Phonetic search is in java.  
> > > I am looking for a PHP library.
> > > 
> > > On Thursday, October 24, 2013 11:10:41 AM UTC+5:30, Hendrik wrote:
> > > 
> > > > maybe a phonetic search is the right for you  
> > > > [GitHub - elastic/elasticsearch-analysis-phonetic: Phonetic Analysis Plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-analysis-phonetic)
> > > > 
> > > > Am Mittwoch, 23. Oktober 2013 17:09:06 UTC+2 schrieb  
> > > > [samir...@wcities.com](mailto:samir...@wcities.com):
> > > > 
> > > > > Dear All,
> > > > > 
> > > > > I want to display best possible results for misspelled search terms
> > > > > 
> > > > > I tried using fuzzy method. It works well for search term having  
> > > > > single word. For multiple words it doesn't return any result.
> > > > > 
> > > > > Below is the sample code.
> > > > > 
> > > > > $result = $es-\>search(array(  
> > > > > 'query' =\> array(  
> > > > > "fuzzy" =\> array(  
> > > > > "name" =\> array(  
> > > > > "value" =\> "jay z",  
> > > > > "boost" =\> 1.0,  
> > > > > "min\_similarity" =\> 0.5,  
> > > > > "prefix\_length" =\> 1  
> > > > > )  
> > > > > )  
> > > > > ),  
> > > > > "from" =\> $start,  
> > > > > "size" =\> $limit  
> > > > > )  
> > > > > );
> > > > > 
> > > > > Thanks,  
> > > > > Samir
> > > > 
> > > > --  
> > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [October 31, 2013, 10:46am UTC](https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074/12 "2013-10-31T10:46:54Z")

</div>

The names you are looking for are name entities. Each entity can have  
variant spellings, such as Kesha and Ke$ha.

Libraries solve this challenge by using name authority files. For example,  
the entity of Kesha is [http://viaf.org/viaf/81878968/](http://viaf.org/viaf/81878968/) and under this URL,  
dereferenced to an URI, you can find the variant names, even at an  
international scope.

To detect such name entities, a special token filter would be required.  
Advanced ones are name entity recognizer (NER) with a large knowledge base.

The standard tokenizers handle '$' and '!!!' as word delimiting characters.  
If it is feasible, you can create synonyms of all the words you want to  
treat as an exception, and set up a synonym filter.

Jörg

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![vallabh\_2](https://avatars.discourse-cdn.com/v4/letter/v/7ab992/32.png) [@vallabh\_2](https://discuss.elastic.co/u/vallabh_2)\
**Post date:** [October 31, 2013, 1:55pm UTC](https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074/13 "2013-10-31T13:55:23Z")

</div>

Thanks for the quick suggestions,  
I tried this method on my side, but it didn't work for me

curl -X PUT '[http://localhost:9200/admin/?pretty=true](http://localhost:9200/admin/?pretty=true)' -d '  
{  
"settings" : {  
"analysis" : {  
"analyzer" : {  
"artist\_analyzer" : {  
"tokenizer" : "standard",  
"filter" : ["standard", "lowercase",  
"artist\_metaphone", "asciifolding", "synonym"]  
}  
},  
"filter" : {  
"artist\_metaphone" : {  
"type" : "phonetic",  
"encoder" : "metaphone",  
"replace" : false  
},  
"synonym" : {  
"type" : "synonym",  
"synonyms" : [  
"kesha =\> ke$ha",  
"!!! =\> !!! (chk chk chk)"  
]  
}  
}  
}  
}  
}  
'  
Am i doing wrong something.  
Any suggestions will be highly appreciated.

On Thursday, October 31, 2013 4:16:54 PM UTC+5:30, Jörg Prante wrote:

> The names you are looking for are name entities. Each entity can have  
> variant spellings, such as Kesha and Ke$ha.
> 
> Libraries solve this challenge by using name authority files. For example,  
> the entity of Kesha is [81878968](http://viaf.org/viaf/81878968/) and under this URL,  
> dereferenced to an URI, you can find the variant names, even at an  
> international scope.
> 
> To detect such name entities, a special token filter would be required.  
> Advanced ones are name entity recognizer (NER) with a large knowledge base.
> 
> The standard tokenizers handle '$' and '!!!' as word delimiting  
> characters. If it is feasible, you can create synonyms of all the words you  
> want to treat as an exception, and set up a synonym filter.
> 
> Jörg

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [November 1, 2013, 7:01pm UTC](https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074/14 "2013-11-01T19:01:47Z")

</div>

I have put up an artist demo

> <https://gist.github.com/jprante/7270193>

Maybe you can get some inspiration from it.

Jörg

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![vallabh\_2](https://avatars.discourse-cdn.com/v4/letter/v/7ab992/32.png) [@vallabh\_2](https://discuss.elastic.co/u/vallabh_2)\
**Post date:** [November 6, 2013, 5:58am UTC](https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074/15 "2013-11-06T05:58:01Z")

</div>

Thanks for the reply,  
Synonym method works for me, it gives ke$ha result when search for kesha  
and ke$ha.  
For synonym i have change "tokenizer" : "standard" to "tokenizer" :  
"whitespace" and found different problem.  
I do have artist name with jay-z (with hyphen in between), earlier when i  
was searching jay z (with whitespace) then it was giving jay-z result but  
now this is not happening due to change in tokenizer.  
Is there way where i can used 2 tokenizer.  
Also is it possible to search exclamation mark (!) in elasticsearch query.

Below is the code,

curl -X PUT '[http://localhost:9200/admin/?pretty=true](http://localhost:9200/admin/?pretty=true)' -d '  
{  
"settings" : {  
"analysis" : {  
"analyzer" : {  
"artist\_analyzer" : {  
"tokenizer" : "whitespace",  
"filter" : ["standard", "lowercase", "synonym",  
"artist\_metaphone", "asciifolding"]  
}  
},  
"filter" : {  
"artist\_metaphone" : {  
"type" : "phonetic",  
"encoder" : "metaphone",  
"replace" : false  
},  
"synonym" : {  
"type" : "synonym",  
"synonyms\_path" :  
"/var/www/html/elasticsearch-master/synonyms.txt"  
}  
}  
}  
}  
}  
'

echo; echo  
echo 'Create the mapping.'  
curl -X PUT  
'[http://localhost:9200/admin/jos\_artist\_details/\_mapping?pretty=true](http://localhost:9200/admin/jos_artist_details/_mapping?pretty=true)' -d '  
{  
"jos\_artist\_details" : {  
"properties" : {  
"name" : {  
"type": "string",  
"index\_analyzer": "artist\_analyzer",  
"search\_analyzer": "artist\_analyzer"  
}

```
}

```

}  
}  
'

On Saturday, November 2, 2013 12:31:47 AM UTC+5:30, Jörg Prante wrote:

> I have put up an artist demo
> 
> [Demo of artist synonyms with special character escaping · GitHub](https://gist.github.com/jprante/7270193)
> 
> Maybe you can get some inspiration from it.
> 
> Jörg

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:08am UTC](https://discuss.elastic.co/t/elastic-search-for-misspelled-words/14074/16 "2017-07-06T02:08:36Z")

</div>


