# ElasticSearch enable Snowball Analyzer and Synonym on Fields

**URL:** <https://discuss.elastic.co/t/elasticsearch-enable-snowball-analyzer-and-synonym-on-fields/20589>\
**Category:** Elasticsearch\
**Created:** [November 5, 2014, 11:43pm UTC](https://discuss.elastic.co/t/elasticsearch-enable-snowball-analyzer-and-synonym-on-fields/20589 "2014-11-05T23:43:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iqbal\_Ahmed](https://avatars.discourse-cdn.com/v4/letter/i/3da27b/32.png) [@Iqbal\_Ahmed](https://discuss.elastic.co/u/Iqbal_Ahmed)\
**Post date:** [November 5, 2014, 11:43pm UTC](https://discuss.elastic.co/t/elasticsearch-enable-snowball-analyzer-and-synonym-on-fields/20589/1 "2014-11-05T23:43:06Z")

</div>

Hi guys,

Originally I posted this in SO but found this place which seems more  
suitable to ask 🙂

I have an elasticsearch index where my default analyzer is the snowball  
analyzer so I can get the stemming and now I need the ability to have  
synonyms on some of the fields as well as the benefit of the snowball  
analyzer to do stemming.

Is this possible and if so how?

As a test I tried to set a synonym filter on the snowball analiyzer, hoping  
that it would enable synonyms on all fields so I can test it but that  
didn't really work...

I created another analyzer for synonyms on my index with the WordNet  
synonym file.

If I am not clear please let me know and I'll try and update. Here is my  
current index settings.

"settings": {  
"index": {  
"analysis": {  
"analyzer": {  
"synonym": {  
"filter": [  
"synonym"  
],  
"tokenizer": "whitespace"  
},  
"default": {  
"language": "English",  
"type": "snowball"  
}  
},  
"filter": {  
"synonym": {  
"type": "synonym",  
"synonyms\_path": "/elasticsearch/wn\_s.pl",  
"format": "wordnet"  
}  
}  
}  
}  
}  
}

--  
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/26511746-d12e-4630-99bb-a4b488c0c201%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/26511746-d12e-4630-99bb-a4b488c0c201%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [November 6, 2014, 3:57pm UTC](https://discuss.elastic.co/t/elasticsearch-enable-snowball-analyzer-and-synonym-on-fields/20589/2 "2014-11-06T15:57:11Z")

</div>

You would need to create a custom analyzer by basically repeating the  
configuration of the snowball analyzer, but adding in the synonym filter.  
You can't modify a stock analyzer, unless this has changed (if so, someone  
please correct me).

--  
Ivan

On Wed, Nov 5, 2014 at 6:43 PM, Iqbal Ahmed [iq.quit@gmail.com](mailto:iq.quit@gmail.com) wrote:

> Hi guys,
> 
> Originally I posted this in SO but found this place which seems more  
> suitable to ask 🙂
> 
> I have an elasticsearch index where my default analyzer is the snowball  
> analyzer so I can get the stemming and now I need the ability to have  
> synonyms on some of the fields as well as the benefit of the snowball  
> analyzer to do stemming.
> 
> Is this possible and if so how?
> 
> As a test I tried to set a synonym filter on the snowball analiyzer,  
> hoping that it would enable synonyms on all fields so I can test it but  
> that didn't really work...
> 
> I created another analyzer for synonyms on my index with the WordNet  
> synonym file.
> 
> If I am not clear please let me know and I'll try and update. Here is my  
> current index settings.
> 
> "settings": {  
> "index": {  
> "analysis": {  
> "analyzer": {  
> "synonym": {  
> "filter": [  
> "synonym"  
> ],  
> "tokenizer": "whitespace"  
> },  
> "default": {  
> "language": "English",  
> "type": "snowball"  
> }  
> },  
> "filter": {  
> "synonym": {  
> "type": "synonym",  
> "synonyms\_path": "/elasticsearch/wn\_s.pl",  
> "format": "wordnet"  
> }  
> }  
> }  
> }  
> }  
> }
> 
> --  
> 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/26511746-d12e-4630-99bb-a4b488c0c201%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/26511746-d12e-4630-99bb-a4b488c0c201%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/26511746-d12e-4630-99bb-a4b488c0c201%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/26511746-d12e-4630-99bb-a4b488c0c201%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/CALY%3DcQComno1ywsjw%3DvhxbhT8oEqQPeWzs9DOqUFDYH-oyLA\_w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQComno1ywsjw%3DvhxbhT8oEqQPeWzs9DOqUFDYH-oyLA_w%40mail.gmail.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, 12:51am UTC](https://discuss.elastic.co/t/elasticsearch-enable-snowball-analyzer-and-synonym-on-fields/20589/3 "2017-07-06T00:51:42Z")

</div>


