# How is managed multiple synonyms?

**URL:** <https://discuss.elastic.co/t/how-is-managed-multiple-synonyms/231956>\
**Category:** Elasticsearch\
**Created:** [May 11, 2020, 8:33am UTC](https://discuss.elastic.co/t/how-is-managed-multiple-synonyms/231956 "2020-05-11T08:33:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![granier](https://avatars.discourse-cdn.com/v4/letter/g/b3f665/32.png) [@granier](https://discuss.elastic.co/u/granier)\
**Post date:** [May 11, 2020, 8:33am UTC](https://discuss.elastic.co/t/how-is-managed-multiple-synonyms/231956/1 "2020-05-11T08:33:48Z")

</div>

Hi, iI understood that a following entry can be set in a synonym file :  
word1, word2 =\> word1, word2

Like that a search on word1 or word2 returns the same set of documents.

I do not understand how such synonyms are handled.

Are the following assumptions true ?

- The inverted index contains one entry for word1 and one for word2
- Each document containing word1 or word2 are referenced by the inverted index entries word1 and word2

And for searches, how is managed a search with word1 or word 2 ? Are two queries executed ? One with word1 and one with word2 ?

Are hightlight and regexp managed with such synonyms ?

Thanks for any helps.

B. Granier

---

<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:** [June 8, 2020, 8:33am UTC](https://discuss.elastic.co/t/how-is-managed-multiple-synonyms/231956/2 "2020-06-08T08:33:52Z")

</div>

Closed on June 8, 2020, 8:33am UTC

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