# Can synonym analyzer or Fuzzy queries return the token that it got matched to from document?

**URL:** https://discuss.elastic.co/t/can-synonym-analyzer-or-fuzzy-queries-return-the-token-that-it-got-matched-to-from-document/342575
**Category:** Elasticsearch
**Created:** [September 8, 2023, 6:22am UTC](https://discuss.elastic.co/t/can-synonym-analyzer-or-fuzzy-queries-return-the-token-that-it-got-matched-to-from-document/342575 "2023-09-08T06:22:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![aashini](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aashini/32/98857_2.png) [@aashini](https://discuss.elastic.co/u/aashini)
#### Post date: [September 8, 2023, 6:22am UTC](https://discuss.elastic.co/t/can-synonym-analyzer-or-fuzzy-queries-return-the-token-that-it-got-matched-to-from-document/342575/1 "2023-09-08T06:22:38Z")

</div>

I am using search-time synonyms in my Index. I am also using fuzzy queries to correct the spelling mistakes of user input in making search.

For example, My Index has a field named Trade which can have value "Plumbing". Now if someone makes a typo and writes "pluming", It matches to Plumbing and returns documents correctly. Since ES returns documents with plumbing and some other trades too, I don't know a way for now to fetch which token it got matched to while returning that document.

Similarly, I have defined multiple synonyms in a file and I want to know which synonym it got matched to while returning a document.

I am using. NEST with .net 6. I have specific requirement to fetch this data but I am not sure if it is feasible and if yes, how to do that. Any pointer is appreciated.

---

<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 6, 2023, 6:23am UTC](https://discuss.elastic.co/t/can-synonym-analyzer-or-fuzzy-queries-return-the-token-that-it-got-matched-to-from-document/342575/2 "2023-10-06T06:23:21Z")

</div>

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