# Autocomplete within multiple fields

**URL:** https://discuss.elastic.co/t/autocomplete-within-multiple-fields/19919
**Category:** Elasticsearch
**Created:** [September 22, 2014, 5:21pm UTC](https://discuss.elastic.co/t/autocomplete-within-multiple-fields/19919 "2014-09-22T17:21:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Julien\_Ricard](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julien_ricard/32/1268_2.png) [@Julien\_Ricard](https://discuss.elastic.co/u/Julien_Ricard)
#### Post date: [September 22, 2014, 5:21pm UTC](https://discuss.elastic.co/t/autocomplete-within-multiple-fields/19919/1 "2014-09-22T17:21:42Z")

</div>

Hi,

I would like to get an autocomplete within multiple fields and get the  
results sorted within all these fields. Now I can do an autocomplete within  
multiple fields but they come unsorted for each one of my searches :

POST /myindex/\_suggest

> {  
> "complete1" : {  
> "text" : "auc",  
> "completion" : {  
> "field" : "[article]title(autocomplete)"  
> }  
> },  
> "complete2" : {  
> "text" : "auc",  
> "completion" : {  
> "field" : "[brand]title(autocomplete)"  
> }  
> }  
> }

result =

- complete1 =\> hits
- complete2 =\> other hits

I would like the results to be sorted. I would like to query something like  
:

POST /myindex/\_suggest

> {  
> "complete1and2" : {  
> "text" : "auc",  
> "completion" : {  
> "fields" : ["[article]title(autocomplete)",  
> "[brand]title(autocomplete)"]  
> }  
> }  
> }

Thank you  
Julien

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/fc571458-e069-404e-a20b-c135c9b82a0f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fc571458-e069-404e-a20b-c135c9b82a0f%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:00am UTC](https://discuss.elastic.co/t/autocomplete-within-multiple-fields/19919/2 "2017-07-06T01:00:36Z")

</div>


