# Adding Synonyms on existing Index

**URL:** <https://discuss.elastic.co/t/adding-synonyms-on-existing-index/6046>\
**Category:** Elasticsearch\
**Created:** [December 2, 2011, 2:31am UTC](https://discuss.elastic.co/t/adding-synonyms-on-existing-index/6046 "2011-12-02T02:31:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg\_Brown](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/greg_brown/32/1373_2.png) [@Greg\_Brown](https://discuss.elastic.co/u/Greg_Brown)\
**Post date:** [December 2, 2011, 2:31am UTC](https://discuss.elastic.co/t/adding-synonyms-on-existing-index/6046/1 "2011-12-02T02:31:43Z")

</div>

Greetings,

I have had a cluster running 0.17.8 which I just just updated to  
0.18.5 and (foolishly) at the same time I added a synonym file with  
the mapping of "plug-in, plug in, plugin, plug-ins, plug ins,  
plugins".

Worked fine on my test server, but when I updated the production  
server (so old 0.17.8 index now running 0.18.5 + synonyms) my searches  
for plugin stopped returning any results even though there had been  
results for each of the terms before. My synonym filter is using the  
default configuration which I think means expand == true and so any of  
the above terms should be rewritten to all of the terms.

By reindexing I'm able to fix the problem (not surprisingly). But it  
would be nice to be able to apply synonyms without reindexing.  
Especially if/when the index gets so big that it would take weeks to  
completely reindex. Any suggestions on what I might have done wrong or  
ways to avoid reindexing in the future?

My Analyzer configuration is:  
index :  
analysis :  
filter :  
light\_stemmer :  
type : stemmer  
name : minimal\_english  
snowball :  
type : snowball  
language : English  
wd\_filter :  
type : word\_delimiter  
generate\_word\_parts : true  
generate\_number\_parts : true  
catenate\_words : true  
split\_on\_case\_change : true  
preserve\_original : true  
split\_on\_numerics: true  
ac\_synonym :  
type : synonym  
synonyms\_path : ac-synonyms.txt  
analyzer :  
default :  
type : custom  
tokenizer : uax\_url\_email  
filter : [wd\_filter,lowercase,light\_stemmer,ac\_synonym]  
char\_filter : [html\_strip]

Thanks  
-Greg

---

<div class="post-metadata">

**Author:** ![ppearcy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppearcy/32/980_2.png) [@ppearcy](https://discuss.elastic.co/u/ppearcy)\
**Post date:** [December 2, 2011, 6:09am UTC](https://discuss.elastic.co/t/adding-synonyms-on-existing-index/6046/2 "2011-12-02T06:09:37Z")

</div>

You could apply the synonym filter to the search analyzer only.  
Otherwise, I'm pretty sure you need to re-index.

On Dec 1, 7:31 pm, Greg Brown [gbrown5...@gmail.com](mailto:gbrown5...@gmail.com) wrote:

> Greetings,
> 
> I have had a cluster running 0.17.8 which I just just updated to  
> 0.18.5 and (foolishly) at the same time I added a synonym file with  
> the mapping of "plug-in, plug in, plugin, plug-ins, plug ins,  
> plugins".
> 
> Worked fine on my test server, but when I updated the production  
> server (so old 0.17.8 index now running 0.18.5 + synonyms) my searches  
> for plugin stopped returning any results even though there had been  
> results for each of the terms before. My synonym filter is using the  
> default configuration which I think means expand == true and so any of  
> the above terms should be rewritten to all of the terms.
> 
> By reindexing I'm able to fix the problem (not surprisingly). But it  
> would be nice to be able to apply synonyms without reindexing.  
> Especially if/when the index gets so big that it would take weeks to  
> completely reindex. Any suggestions on what I might have done wrong or  
> ways to avoid reindexing in the future?
> 
> My Analyzer configuration is:  
> index :  
> analysis :  
> filter :  
> light\_stemmer :  
> type : stemmer  
> name : minimal\_english  
> snowball :  
> type : snowball  
> language : English  
> wd\_filter :  
> type : word\_delimiter  
> generate\_word\_parts : true  
> generate\_number\_parts : true  
> catenate\_words : true  
> split\_on\_case\_change : true  
> preserve\_original : true  
> split\_on\_numerics: true  
> ac\_synonym :  
> type : synonym  
> synonyms\_path : ac-synonyms.txt  
> analyzer :  
> default :  
> type : custom  
> tokenizer : uax\_url\_email  
> filter : [wd\_filter,lowercase,light\_stemmer,ac\_synonym]  
> char\_filter : [html\_strip]
> 
> Thanks  
> -Greg

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 2, 2011, 2:48pm UTC](https://discuss.elastic.co/t/adding-synonyms-on-existing-index/6046/3 "2011-12-02T14:48:07Z")

</div>

You can update the synonym file itself, and then close and open the index,  
it will re-read the synonym file.

On Fri, Dec 2, 2011 at 4:31 AM, Greg Brown [gbrown5878@gmail.com](mailto:gbrown5878@gmail.com) wrote:

> Greetings,
> 
> I have had a cluster running 0.17.8 which I just just updated to  
> 0.18.5 and (foolishly) at the same time I added a synonym file with  
> the mapping of "plug-in, plug in, plugin, plug-ins, plug ins,  
> plugins".
> 
> Worked fine on my test server, but when I updated the production  
> server (so old 0.17.8 index now running 0.18.5 + synonyms) my searches  
> for plugin stopped returning any results even though there had been  
> results for each of the terms before. My synonym filter is using the  
> default configuration which I think means expand == true and so any of  
> the above terms should be rewritten to all of the terms.
> 
> By reindexing I'm able to fix the problem (not surprisingly). But it  
> would be nice to be able to apply synonyms without reindexing.  
> Especially if/when the index gets so big that it would take weeks to  
> completely reindex. Any suggestions on what I might have done wrong or  
> ways to avoid reindexing in the future?
> 
> My Analyzer configuration is:  
> index :  
> analysis :  
> filter :  
> light\_stemmer :  
> type : stemmer  
> name : minimal\_english  
> snowball :  
> type : snowball  
> language : English  
> wd\_filter :  
> type : word\_delimiter  
> generate\_word\_parts : true  
> generate\_number\_parts : true  
> catenate\_words : true  
> split\_on\_case\_change : true  
> preserve\_original : true  
> split\_on\_numerics: true  
> ac\_synonym :  
> type : synonym  
> synonyms\_path : ac-synonyms.txt  
> analyzer :  
> default :  
> type : custom  
> tokenizer : uax\_url\_email  
> filter : [wd\_filter,lowercase,light\_stemmer,ac\_synonym]  
> char\_filter : [html\_strip]
> 
> Thanks  
> -Greg

---

<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, 3:46am UTC](https://discuss.elastic.co/t/adding-synonyms-on-existing-index/6046/4 "2017-07-06T03:46:35Z")

</div>


