# Synonym search using .txt file

**URL:** <https://discuss.elastic.co/t/synonym-search-using-txt-file/99366>\
**Category:** Elasticsearch\
**Created:** [September 5, 2017, 5:23am UTC](https://discuss.elastic.co/t/synonym-search-using-txt-file/99366 "2017-09-05T05:23:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashwini\_Kumar](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@Ashwini\_Kumar](https://discuss.elastic.co/u/Ashwini_Kumar)\
**Post date:** [September 5, 2017, 5:23am UTC](https://discuss.elastic.co/t/synonym-search-using-txt-file/99366/1 "2017-09-05T05:23:03Z")

</div>

[https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-synonym-tokenfilter.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-synonym-tokenfilter.html)

I'm using synonym search by giving all the synonyms in the file. This file is being indexed at the time of index creation. How can I add more synonyms to this file and use newly added synonyms??

One solution is to reindex the data but my data is around 20GB so I have kept that as a last option.

Thanks

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [September 5, 2017, 7:43am UTC](https://discuss.elastic.co/t/synonym-search-using-txt-file/99366/2 "2017-09-05T07:43:47Z")

</div>

Synonyms can be applied to the text of documents at index time or the text of queries at query time.  
There are pros and cons to each approach which are listed here: [https://www.elastic.co/guide/en/elasticsearch/guide/2.x/synonyms-expand-or-contract.html#synonyms-expansion](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/synonyms-expand-or-contract.html#synonyms-expansion)

---

<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:** [October 3, 2017, 7:44am UTC](https://discuss.elastic.co/t/synonym-search-using-txt-file/99366/3 "2017-10-03T07:44:03Z")

</div>

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