# Help with search results

**URL:** https://discuss.elastic.co/t/help-with-search-results/138285
**Category:** Elasticsearch
**Created:** [July 2, 2018, 10:41pm UTC](https://discuss.elastic.co/t/help-with-search-results/138285 "2018-07-02T22:41:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jor3l](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jor3l/32/32887_2.png) [@jor3l](https://discuss.elastic.co/u/jor3l)
#### Post date: [July 2, 2018, 10:41pm UTC](https://discuss.elastic.co/t/help-with-search-results/138285/1 "2018-07-02T22:41:05Z")

</div>

Hello there!

I'm new to elastic and have been trying the whole day to figure out a way of achieve the following:

Imagine I have a list of users, some of them named "Carrie Elastic" and "Car Lastname", when I do a query with the match set to "Car", I get both of them, when I do a search with "Carrie" I still get the two but ordered accordingly to the score.

The thing I'm trying to do is to exclude "Car" as soon as the user keeps typing (and making the search more specific).

Already tried with fuzzy, terms, query\_string and they work at some point, some of them stop working when I have the full name typed (and this is not desired). Don't think wildcard or regexp is a solution so didn't try them.

Any help is appreciated. Thanks

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [July 3, 2018, 2:26am UTC](https://discuss.elastic.co/t/help-with-search-results/138285/2 "2018-07-03T02:26:02Z")

</div>

You can use a ngram based analyzer at index time and a simple analyzer at search time.

The last example of this script shows it:

> <https://gist.github.com/dadoonet/f911291c4dd19b0802031db3064c648f>

HTH

---

<div class="post-metadata">

### Author: ![jor3l](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jor3l/32/32887_2.png) [@jor3l](https://discuss.elastic.co/u/jor3l)
#### Post date: [July 3, 2018, 6:53pm UTC](https://discuss.elastic.co/t/help-with-search-results/138285/3 "2018-07-03T18:53:16Z")

</div>

Thank you sir, I'll give it a look. Seems a lot more complex than I thought

---

<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 31, 2018, 6:53pm UTC](https://discuss.elastic.co/t/help-with-search-results/138285/4 "2018-07-31T18:53:21Z")

</div>

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