# Search query returning a different result instead of following the query

**URL:** https://discuss.elastic.co/t/search-query-returning-a-different-result-instead-of-following-the-query/223268
**Category:** Elastic Search
**Tags:** elastic-app-search
**Created:** [March 12, 2020, 7:24am UTC](https://discuss.elastic.co/t/search-query-returning-a-different-result-instead-of-following-the-query/223268 "2020-03-12T07:24:55Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![varunharidas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/varunharidas/32/63704_2.png) [@varunharidas](https://discuss.elastic.co/u/varunharidas)
#### Post date: [March 12, 2020, 7:24am UTC](https://discuss.elastic.co/t/search-query-returning-a-different-result-instead-of-following-the-query/223268/1 "2020-03-12T07:24:55Z")

</div>

I'm trying to search **joseph sunny** but when I type and reach **joseph sun** I'm getting this result which finds a person with just **sun** in the name field. See the screenshots for clarity - running self-hosted.

When i type **joseph sunny** completely

 ![b30e40582faf649a644438329be9b521adee86c8](https://us1.discourse-cdn.com/elastic/original/3X/2/f/2fef857d030d8484ba1c469cadc606af158062cb.png)

When I reach **joseph sun**

 ![6397dda24defc0998424c6cccdbdf239a418b2b5](https://us1.discourse-cdn.com/elastic/original/3X/c/b/cba9a0822136770b85fa27d65ca2192d669377f6.png)

---

<div class="post-metadata">

### Author: ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)
#### Post date: [March 12, 2020, 11:45am UTC](https://discuss.elastic.co/t/search-query-returning-a-different-result-instead-of-following-the-query/223268/2 "2020-03-12T11:45:26Z")

</div>

Hey @varunharidas ,

I think that's expected. As you can probably imagine, I think our search sees the exact match on "sun" and so scores the document really well.

I'm not sure if there's any way to work around it. If you wanted to, you could probably apply a value boost on the "name" field for "Joseph Sunny", or even create a curation for "joseph sun".

Are you using this for an autocomplete? If so, you could use Query Suggestions which would probably give you the behavior you are looking for.

Otherwise, in my opinion I'd just leave this as is. At the end of the day, do you think this would cause a user to **not** find what they're looking for?

---

<div class="post-metadata">

### Author: ![varunharidas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/varunharidas/32/63704_2.png) [@varunharidas](https://discuss.elastic.co/u/varunharidas)
#### Post date: [March 12, 2020, 2:44pm UTC](https://discuss.elastic.co/t/search-query-returning-a-different-result-instead-of-following-the-query/223268/3 "2020-03-12T14:44:06Z")

</div>

Hi @JasonStoltz,

Okay I got it. I think I was using search endpoint for displaying suggestions 🤦🏻‍♂️  
Thanks for pointing it out. Well explained 💥

---

<div class="post-metadata">

### Author: ![varunharidas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/varunharidas/32/63704_2.png) [@varunharidas](https://discuss.elastic.co/u/varunharidas)
#### Post date: [March 12, 2020, 2:46pm UTC](https://discuss.elastic.co/t/search-query-returning-a-different-result-instead-of-following-the-query/223268/4 "2020-03-12T14:46:05Z")

</div>

@JasonStoltz Actually this came up after querying from algolia dash, as they are displaying query suggestion when we search in the index from their dashboard. However app-search is using search endpoint dynamically to display results below as they need to show the whole document. Got it now. 👍

---

<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: [April 9, 2020, 2:46pm UTC](https://discuss.elastic.co/t/search-query-returning-a-different-result-instead-of-following-the-query/223268/5 "2020-04-09T14:46:06Z")

</div>

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