# Getting multi-word synonyms used in the search for display

**URL:** <https://discuss.elastic.co/t/getting-multi-word-synonyms-used-in-the-search-for-display/261460>\
**Category:** Elasticsearch\
**Created:** [January 18, 2021, 6:17pm UTC](https://discuss.elastic.co/t/getting-multi-word-synonyms-used-in-the-search-for-display/261460 "2021-01-18T18:17:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![julioz](https://avatars.discourse-cdn.com/v4/letter/j/8797f3/32.png) [@julioz](https://discuss.elastic.co/u/julioz)\
**Post date:** [January 18, 2021, 6:17pm UTC](https://discuss.elastic.co/t/getting-multi-word-synonyms-used-in-the-search-for-display/261460/1 "2021-01-18T18:17:20Z")

</div>

I am developing a search system using Elasticsearch. In this system, users can register synonyms.  
When performing a search, in addition to the return of the documents, it is also necessary to display which of the synonyms were used in the search.  
I am currently running a separate query using Analyze to get this list of synonyms.  
The problem is that there are cases where there are several multi-word synonyms and the return, by tokens, makes it difficult to obtain the data for display.  
I tried to create an Analyzer using the keyword Tokenizer, but it only needs the synonym as a search term, which does not happen in a real search.

Any suggestions as to what would be the best approach to this problem?  
Thanks.

---

<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:** [February 15, 2021, 6:17pm UTC](https://discuss.elastic.co/t/getting-multi-word-synonyms-used-in-the-search-for-display/261460/2 "2021-02-15T18:17:30Z")

</div>

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