# Autocomplete suggester Java API?

**URL:** <https://discuss.elastic.co/t/autocomplete-suggester-java-api/16199>\
**Category:** Elasticsearch\
**Created:** [March 6, 2014, 4:18pm UTC](https://discuss.elastic.co/t/autocomplete-suggester-java-api/16199 "2014-03-06T16:18:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dantuff](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@dantuff](https://discuss.elastic.co/u/dantuff)\
**Post date:** [March 6, 2014, 4:18pm UTC](https://discuss.elastic.co/t/autocomplete-suggester-java-api/16199/1 "2014-03-06T16:18:16Z")

</div>

I'm changing our current autocomplete implementation to use the new  
autocomplete suggester as below. Is there a Java API available to send the  
suggest search request to ElasticSearch?

> **[You Complete Me
	  	 | Elastic](https://www.elastic.co/blog/you-complete-me)**
>
> Effective search is not just about returning relevant results when a user types in a search phrase, it's also about helping your user to choose the best search phrases. Elasticsearch already has did-y...

--  
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/2ef13bbf-585a-4dd2-97d8-28b6edd6d1f0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2ef13bbf-585a-4dd2-97d8-28b6edd6d1f0%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dantuff](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@dantuff](https://discuss.elastic.co/u/dantuff)\
**Post date:** [March 6, 2014, 4:56pm UTC](https://discuss.elastic.co/t/autocomplete-suggester-java-api/16199/2 "2014-03-06T16:56:02Z")

</div>

I found an example in the tests, if anyone else is looking for it and comes  
across this post:

SuggestResponse suggestResponse =  
client().prepareSuggest(INDEX).addSuggestion(  
new  
CompletionSuggestionBuilder("testSuggestions").field(FIELD).text("foo").size(10)

On Thursday, March 6, 2014 4:18:16 PM UTC, Dan wrote:

> I'm changing our current autocomplete implementation to use the new  
> autocomplete suggester as below. Is there a Java API available to send the  
> suggest search request to Elasticsearch?
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/you-complete-me/)

--  
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/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Amit\_Soni](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@Amit\_Soni](https://discuss.elastic.co/u/Amit_Soni)\
**Post date:** [March 6, 2014, 5:03pm UTC](https://discuss.elastic.co/t/autocomplete-suggester-java-api/16199/3 "2014-03-06T17:03:14Z")

</div>

This is another class for fuzzy match: CompletionSuggestionFuzzyBuilder

-Amit.

On Thu, Mar 6, 2014 at 8:56 AM, Dan [dan.tuffery@gmail.com](mailto:dan.tuffery@gmail.com) wrote:

> I found an example in the tests, if anyone else is looking for it and  
> comes across this post:
> 
> SuggestResponse suggestResponse =  
> client().prepareSuggest(INDEX).addSuggestion(  
> new  
> CompletionSuggestionBuilder("testSuggestions").field(FIELD).text("foo").size(10)
> 
> On Thursday, March 6, 2014 4:18:16 PM UTC, Dan wrote:
> 
> > I'm changing our current autocomplete implementation to use the new  
> > autocomplete suggester as below. Is there a Java API available to send the  
> > suggest search request to Elasticsearch?
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/you-complete-me/)
> 
> --  
> 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/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dantuff](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@dantuff](https://discuss.elastic.co/u/dantuff)\
**Post date:** [March 6, 2014, 5:10pm UTC](https://discuss.elastic.co/t/autocomplete-suggester-java-api/16199/4 "2014-03-06T17:10:45Z")

</div>

Thanks Amit. Is there anyway to execute the autocomplete suggest on  
multiple fields within the same request?

On Thu, Mar 6, 2014 at 5:03 PM, Amit Soni [amitsoni29@gmail.com](mailto:amitsoni29@gmail.com) wrote:

> This is another class for fuzzy match: CompletionSuggestionFuzzyBuilder
> 
> -Amit.
> 
> On Thu, Mar 6, 2014 at 8:56 AM, Dan [dan.tuffery@gmail.com](mailto:dan.tuffery@gmail.com) wrote:
> 
> > I found an example in the tests, if anyone else is looking for it and  
> > comes across this post:
> > 
> > SuggestResponse suggestResponse =  
> > client().prepareSuggest(INDEX).addSuggestion(  
> > new  
> > CompletionSuggestionBuilder("testSuggestions").field(FIELD).text("foo").size(10)
> > 
> > On Thursday, March 6, 2014 4:18:16 PM UTC, Dan wrote:
> > 
> > > I'm changing our current autocomplete implementation to use the new  
> > > autocomplete suggester as below. Is there a Java API available to send the  
> > > suggest search request to Elasticsearch?
> > > 
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/you-complete-me/)
> > 
> > --  
> > 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/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com)[https://groups.google.com/d/msgid/elasticsearch/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/CAEyth3vSxQrXiQe6kTTM9-fbYGD9ojVhGOerG8KZtmB42yK3tg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEyth3vSxQrXiQe6kTTM9-fbYGD9ojVhGOerG8KZtmB42yK3tg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Amit\_Soni](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@Amit\_Soni](https://discuss.elastic.co/u/Amit_Soni)\
**Post date:** [March 6, 2014, 5:29pm UTC](https://discuss.elastic.co/t/autocomplete-suggester-java-api/16199/5 "2014-03-06T17:29:41Z")

</div>

I think you can do that by specifying a different id for each of the  
different suggestion types you want to include in the request.

"suggest" : {  
"id\_1" : {  
...............//put your suggestor for one field here  
},  
"id2" : {  
.................//put your suggestor for second field here  
}  
}

-Amit.

On Thu, Mar 6, 2014 at 9:10 AM, Dan Tuffery [dan.tuffery@gmail.com](mailto:dan.tuffery@gmail.com) wrote:

> Thanks Amit. Is there anyway to execute the autocomplete suggest on  
> multiple fields within the same request?
> 
> On Thu, Mar 6, 2014 at 5:03 PM, Amit Soni [amitsoni29@gmail.com](mailto:amitsoni29@gmail.com) wrote:
> 
> > This is another class for fuzzy match: CompletionSuggestionFuzzyBuilder
> > 
> > -Amit.
> > 
> > On Thu, Mar 6, 2014 at 8:56 AM, Dan [dan.tuffery@gmail.com](mailto:dan.tuffery@gmail.com) wrote:
> > 
> > > I found an example in the tests, if anyone else is looking for it and  
> > > comes across this post:
> > > 
> > > SuggestResponse suggestResponse =  
> > > client().prepareSuggest(INDEX).addSuggestion(  
> > > new  
> > > CompletionSuggestionBuilder("testSuggestions").field(FIELD).text("foo").size(10)
> > > 
> > > On Thursday, March 6, 2014 4:18:16 PM UTC, Dan wrote:
> > > 
> > > > I'm changing our current autocomplete implementation to use the new  
> > > > autocomplete suggester as below. Is there a Java API available to send the  
> > > > suggest search request to Elasticsearch?
> > > > 
> > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/you-complete-me/)
> > > 
> > > --  
> > > 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/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > > 
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > 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/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com)[https://groups.google.com/d/msgid/elasticsearch/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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/CAEyth3vSxQrXiQe6kTTM9-fbYGD9ojVhGOerG8KZtmB42yK3tg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEyth3vSxQrXiQe6kTTM9-fbYGD9ojVhGOerG8KZtmB42yK3tg%40mail.gmail.com)[https://groups.google.com/d/msgid/elasticsearch/CAEyth3vSxQrXiQe6kTTM9-fbYGD9ojVhGOerG8KZtmB42yK3tg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAEyth3vSxQrXiQe6kTTM9-fbYGD9ojVhGOerG8KZtmB42yK3tg%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/CAAOGaQJxgWzuvr0eEm%2BE-pzwW2P4d9kN19PTUQTwKe6PSqh%2B0A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQJxgWzuvr0eEm%2BE-pzwW2P4d9kN19PTUQTwKe6PSqh%2B0A%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dantuff](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@dantuff](https://discuss.elastic.co/u/dantuff)\
**Post date:** [March 6, 2014, 5:38pm UTC](https://discuss.elastic.co/t/autocomplete-suggester-java-api/16199/6 "2014-03-06T17:38:11Z")

</div>

No, that doesn't seem to work.

On Thu, Mar 6, 2014 at 5:29 PM, Amit Soni [amitsoni29@gmail.com](mailto:amitsoni29@gmail.com) wrote:

> I think you can do that by specifying a different id for each of the  
> different suggestion types you want to include in the request.
> 
> "suggest" : {  
> "id\_1" : {  
> ...............//put your suggestor for one field here  
> },  
> "id2" : {  
> .................//put your suggestor for second field here  
> }  
> }
> 
> -Amit.
> 
> On Thu, Mar 6, 2014 at 9:10 AM, Dan Tuffery [dan.tuffery@gmail.com](mailto:dan.tuffery@gmail.com) wrote:
> 
> > Thanks Amit. Is there anyway to execute the autocomplete suggest on  
> > multiple fields within the same request?
> > 
> > On Thu, Mar 6, 2014 at 5:03 PM, Amit Soni [amitsoni29@gmail.com](mailto:amitsoni29@gmail.com) wrote:
> > 
> > > This is another class for fuzzy match: CompletionSuggestionFuzzyBuilder
> > > 
> > > -Amit.
> > > 
> > > On Thu, Mar 6, 2014 at 8:56 AM, Dan [dan.tuffery@gmail.com](mailto:dan.tuffery@gmail.com) wrote:
> > > 
> > > > I found an example in the tests, if anyone else is looking for it and  
> > > > comes across this post:
> > > > 
> > > > SuggestResponse suggestResponse =  
> > > > client().prepareSuggest(INDEX).addSuggestion(  
> > > > new  
> > > > CompletionSuggestionBuilder("testSuggestions").field(FIELD).text("foo").size(10)
> > > > 
> > > > On Thursday, March 6, 2014 4:18:16 PM UTC, Dan wrote:
> > > > 
> > > > > I'm changing our current autocomplete implementation to use the new  
> > > > > autocomplete suggester as below. Is there a Java API available to send the  
> > > > > suggest search request to Elasticsearch?
> > > > > 
> > > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/you-complete-me/)
> > > > 
> > > > --  
> > > > 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/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .
> > > > 
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > 
> > > --  
> > > 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/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com)[https://groups.google.com/d/msgid/elasticsearch/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > .
> > > 
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > 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/CAEyth3vSxQrXiQe6kTTM9-fbYGD9ojVhGOerG8KZtmB42yK3tg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEyth3vSxQrXiQe6kTTM9-fbYGD9ojVhGOerG8KZtmB42yK3tg%40mail.gmail.com)[https://groups.google.com/d/msgid/elasticsearch/CAEyth3vSxQrXiQe6kTTM9-fbYGD9ojVhGOerG8KZtmB42yK3tg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAEyth3vSxQrXiQe6kTTM9-fbYGD9ojVhGOerG8KZtmB42yK3tg%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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/CAAOGaQJxgWzuvr0eEm%2BE-pzwW2P4d9kN19PTUQTwKe6PSqh%2B0A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQJxgWzuvr0eEm%2BE-pzwW2P4d9kN19PTUQTwKe6PSqh%2B0A%40mail.gmail.com)[https://groups.google.com/d/msgid/elasticsearch/CAAOGaQJxgWzuvr0eEm%2BE-pzwW2P4d9kN19PTUQTwKe6PSqh%2B0A%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQJxgWzuvr0eEm%2BE-pzwW2P4d9kN19PTUQTwKe6PSqh%2B0A%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/CAEyth3tyjHnUgGVFsngU2y44O8zxV4BCO2SA6%3DOTdjjekNamEw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEyth3tyjHnUgGVFsngU2y44O8zxV4BCO2SA6%3DOTdjjekNamEw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 7, 2014, 8:19am UTC](https://discuss.elastic.co/t/autocomplete-suggester-java-api/16199/7 "2014-03-07T08:19:52Z")

</div>

Hey

just to clarify here: you can configure multiple suggest requests inside a  
single one (as Amit suggested), but you cannot have more than one field per  
single suggest request.

--Alex

On Thu, Mar 6, 2014 at 6:38 PM, Dan Tuffery [dan.tuffery@gmail.com](mailto:dan.tuffery@gmail.com) wrote:

> No, that doesn't seem to work.
> 
> On Thu, Mar 6, 2014 at 5:29 PM, Amit Soni [amitsoni29@gmail.com](mailto:amitsoni29@gmail.com) wrote:
> 
> > I think you can do that by specifying a different id for each of the  
> > different suggestion types you want to include in the request.
> > 
> > "suggest" : {  
> > "id\_1" : {  
> > ...............//put your suggestor for one field here  
> > },  
> > "id2" : {  
> > .................//put your suggestor for second field here  
> > }  
> > }
> > 
> > -Amit.
> > 
> > On Thu, Mar 6, 2014 at 9:10 AM, Dan Tuffery [dan.tuffery@gmail.com](mailto:dan.tuffery@gmail.com)wrote:
> > 
> > > Thanks Amit. Is there anyway to execute the autocomplete suggest on  
> > > multiple fields within the same request?
> > > 
> > > On Thu, Mar 6, 2014 at 5:03 PM, Amit Soni [amitsoni29@gmail.com](mailto:amitsoni29@gmail.com) wrote:
> > > 
> > > > This is another class for fuzzy match: CompletionSuggestionFuzzyBuilder
> > > > 
> > > > -Amit.
> > > > 
> > > > On Thu, Mar 6, 2014 at 8:56 AM, Dan [dan.tuffery@gmail.com](mailto:dan.tuffery@gmail.com) wrote:
> > > > 
> > > > > I found an example in the tests, if anyone else is looking for it and  
> > > > > comes across this post:
> > > > > 
> > > > > SuggestResponse suggestResponse =  
> > > > > client().prepareSuggest(INDEX).addSuggestion(  
> > > > > new  
> > > > > CompletionSuggestionBuilder("testSuggestions").field(FIELD).text("foo").size(10)
> > > > > 
> > > > > On Thursday, March 6, 2014 4:18:16 PM UTC, Dan wrote:
> > > > > 
> > > > > > I'm changing our current autocomplete implementation to use the new  
> > > > > > autocomplete suggester as below. Is there a Java API available to send the  
> > > > > > suggest search request to Elasticsearch?
> > > > > > 
> > > > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/you-complete-me/)
> > > > > 
> > > > > --  
> > > > > 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/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e0e3fca2-cb22-4653-8f39-7636b2379bdc%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .
> > > > > 
> > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > 
> > > > --  
> > > > 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/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com)[https://groups.google.com/d/msgid/elasticsearch/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQ%2BbMbmfymyXUgbnKkHVE-Fk%2BYfuZc3waCbhgec%3D76b-7Q%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > > .
> > > > 
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > 
> > > --  
> > > 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/CAEyth3vSxQrXiQe6kTTM9-fbYGD9ojVhGOerG8KZtmB42yK3tg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEyth3vSxQrXiQe6kTTM9-fbYGD9ojVhGOerG8KZtmB42yK3tg%40mail.gmail.com)[https://groups.google.com/d/msgid/elasticsearch/CAEyth3vSxQrXiQe6kTTM9-fbYGD9ojVhGOerG8KZtmB42yK3tg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAEyth3vSxQrXiQe6kTTM9-fbYGD9ojVhGOerG8KZtmB42yK3tg%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > .
> > > 
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > 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/CAAOGaQJxgWzuvr0eEm%2BE-pzwW2P4d9kN19PTUQTwKe6PSqh%2B0A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQJxgWzuvr0eEm%2BE-pzwW2P4d9kN19PTUQTwKe6PSqh%2B0A%40mail.gmail.com)[https://groups.google.com/d/msgid/elasticsearch/CAAOGaQJxgWzuvr0eEm%2BE-pzwW2P4d9kN19PTUQTwKe6PSqh%2B0A%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQJxgWzuvr0eEm%2BE-pzwW2P4d9kN19PTUQTwKe6PSqh%2B0A%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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/CAEyth3tyjHnUgGVFsngU2y44O8zxV4BCO2SA6%3DOTdjjekNamEw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEyth3tyjHnUgGVFsngU2y44O8zxV4BCO2SA6%3DOTdjjekNamEw%40mail.gmail.com)[https://groups.google.com/d/msgid/elasticsearch/CAEyth3tyjHnUgGVFsngU2y44O8zxV4BCO2SA6%3DOTdjjekNamEw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAEyth3tyjHnUgGVFsngU2y44O8zxV4BCO2SA6%3DOTdjjekNamEw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/CAGCwEM-79%3Dw7hoDvQj4aLbja4%3DY\_Kxrt6Li4-r86rjL%3DYGjjCA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM-79%3Dw7hoDvQj4aLbja4%3DY_Kxrt6Li4-r86rjL%3DYGjjCA%40mail.gmail.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:45am UTC](https://discuss.elastic.co/t/autocomplete-suggester-java-api/16199/8 "2017-07-06T01:45:06Z")

</div>


