# Matching with analyzer

**URL:** <https://discuss.elastic.co/t/matching-with-analyzer/250214>\
**Category:** Elasticsearch\
**Created:** [September 28, 2020, 3:00pm UTC](https://discuss.elastic.co/t/matching-with-analyzer/250214 "2020-09-28T15:00:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![st1nc1ty](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@st1nc1ty](https://discuss.elastic.co/u/st1nc1ty)\
**Post date:** [September 28, 2020, 3:00pm UTC](https://discuss.elastic.co/t/matching-with-analyzer/250214/1 "2020-09-28T15:00:52Z")

</div>

I've got a fairly simple index that has a first and last name that are both have an ngram analyzer attached. It's working well as I can search "ali" and get "alice" among others. I probably already know the answer but is there a way to only return exact matches if and only if there are? So in this example the search term is "ali", I want to only return the document that has the first name of "Ali" but if I search "alic" I want to return "Alice" and any other that could be matched via the analyzer. The end user is only going to have a simple search bar.

---

<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 26, 2020, 3:00pm UTC](https://discuss.elastic.co/t/matching-with-analyzer/250214/2 "2020-10-26T15:00:59Z")

</div>

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