# How to update synonyms for an indexing index

**URL:** <https://discuss.elastic.co/t/how-to-update-synonyms-for-an-indexing-index/237221>\
**Category:** Elasticsearch\
**Created:** [June 16, 2020, 5:48am UTC](https://discuss.elastic.co/t/how-to-update-synonyms-for-an-indexing-index/237221 "2020-06-16T05:48:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravinder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravinder/32/69362_2.png) [@ravinder](https://discuss.elastic.co/u/ravinder)\
**Post date:** [June 16, 2020, 5:48am UTC](https://discuss.elastic.co/t/how-to-update-synonyms-for-an-indexing-index/237221/1 "2020-06-16T05:48:09Z")

</div>

we have an index "testsynonyms" mapped to a synonym file "synonyms.txt",

we want to provision user with a utility of updating synonyms from the User Interface of our application.

is there any way that we can update the existing synonyms or any other alternative solution to make this work.

I have tried to update the synonyms for the existing index, but I always see the "resource\_already\_exists" error.

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [June 16, 2020, 5:38pm UTC](https://discuss.elastic.co/t/how-to-update-synonyms-for-an-indexing-index/237221/2 "2020-06-16T17:38:11Z")

</div>

There is a way to update synonyms, but only at search time. See [this blog post](https://www.elastic.co/blog/boosting-the-power-of-elasticsearch-with-synonyms), especially the part around "Synonyms, reloaded" for reference.

---

<div class="post-metadata">

**Author:** ![ravinder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravinder/32/69362_2.png) [@ravinder](https://discuss.elastic.co/u/ravinder)\
**Post date:** [June 17, 2020, 1:13am UTC](https://discuss.elastic.co/t/how-to-update-synonyms-for-an-indexing-index/237221/3 "2020-06-17T01:13:14Z")

</div>

I think thats how to refresh a synonym file aftet updating the file manually right. But i was looking for anyway where we can update the file(synonym file) using some query.

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [June 23, 2020, 8:43am UTC](https://discuss.elastic.co/t/how-to-update-synonyms-for-an-indexing-index/237221/4 "2020-06-23T08:43:58Z")

</div>

> [@ravinder](#):
>
> But i was looking for anyway where we can update the file(synonym file) using some query.

Thats currently not possible. If you need that kind of flexibility I would suggest looking into query expansion at search time, i.e. keeping a separate resource with synonyms etc in your client and adding additional query terms to the user-provided query in your application layer.

---

<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 21, 2020, 8:44am UTC](https://discuss.elastic.co/t/how-to-update-synonyms-for-an-indexing-index/237221/5 "2020-07-21T08:44:03Z")

</div>

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