# Autocomplete search in both title and body

**URL:** <https://discuss.elastic.co/t/autocomplete-search-in-both-title-and-body/258442>\
**Category:** Elastic Search\
**Tags:** elastic-site-search\
**Created:** [December 11, 2020, 6:03pm UTC](https://discuss.elastic.co/t/autocomplete-search-in-both-title-and-body/258442 "2020-12-11T18:03:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ofer\_Ben-Dayan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ofer_ben-dayan/32/80723_2.png) [@Ofer\_Ben-Dayan](https://discuss.elastic.co/u/Ofer_Ben-Dayan)\
**Post date:** [December 11, 2020, 6:03pm UTC](https://discuss.elastic.co/t/autocomplete-search-in-both-title-and-body/258442/1 "2020-12-11T18:03:57Z")

</div>

Hi!

We've made a custom implementation of the api, using the  
"search" endpoint instead of the "suggest", so the autocomplete suggestion mechanism searches both title and body of our documents.

The problem - while the search in the title is conducted from the  
first character, results from the body are shown only if the whole string  
was found.  
For example, if we are typing "resp", we are getting 3 suggested results,  
in which the word "responsive" appears in the title, and if we complete the  
search term to "responsive", we get a number of additional results, that  
the word "responsive" appears in their body.

Is there any way to customize this, so we will be able to search the body  
from the first character, similar to the title search?

Thanks!

---

<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:** [December 11, 2020, 6:20pm UTC](https://discuss.elastic.co/t/autocomplete-search-in-both-title-and-body/258442/2 "2020-12-11T18:20:22Z")

</div>

Can you confirm that you are using Site Search, and not App Search?

What does the API request you are sending look like?

Are you using a javascript library like [https://github.com/elastic/search-ui](https://github.com/elastic/search-ui) or are you using your own javascript?

Please provide as much detail as possible so we are able to assist you.

Thanks,

Jason

---

<div class="post-metadata">

**Author:** ![Ofer\_Ben-Dayan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ofer_ben-dayan/32/80723_2.png) [@Ofer\_Ben-Dayan](https://discuss.elastic.co/u/Ofer_Ben-Dayan)\
**Post date:** [December 13, 2020, 7:24am UTC](https://discuss.elastic.co/t/autocomplete-search-in-both-title-and-body/258442/3 "2020-12-13T07:24:26Z")

</div>

> [@JasonStoltz](#):
>
> What does the API request you are sending look like?
> 
> Are you using a javascript library like [GitHub - elastic/search-ui: Search UI. Libraries for the fast development of modern, engaging search experiences.](https://github.com/elastic/search-ui) or are you using your own javascript?

Hey! thanks for the reply.  
Yes, we are using Site Search but not our own Javascript nor the search-ui, we are using this:

> **[GitHub - swiftype/swiftype-autocomplete-jquery: Elastic Site Search jQuery...](https://github.com/swiftype/swiftype-autocomplete-jquery#customization-tutorial)**
>
> Elastic Site Search jQuery autocomplete plugin. Contribute to swiftype/swiftype-autocomplete-jquery development by creating an account on GitHub.

and this api:  
[https://api.swiftype.com/api/v1/public/engines/search.json?callback=jQuery17105405937341112437\_1607608363859&q=](https://api.swiftype.com/api/v1/public/engines/search.json?callback=jQuery17105405937341112437_1607608363859&q=).

---

<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:** [January 10, 2021, 7:24am UTC](https://discuss.elastic.co/t/autocomplete-search-in-both-title-and-body/258442/4 "2021-01-10T07:24:28Z")

</div>

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