# How to use suggest from java api

**URL:** <https://discuss.elastic.co/t/how-to-use-suggest-from-java-api/11775>\
**Category:** Elasticsearch\
**Created:** [May 1, 2013, 10:15pm UTC](https://discuss.elastic.co/t/how-to-use-suggest-from-java-api/11775 "2013-05-01T22:15:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![OutNSpace](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/outnspace/32/2468_2.png) [@OutNSpace](https://discuss.elastic.co/u/OutNSpace)\
**Post date:** [May 1, 2013, 10:15pm UTC](https://discuss.elastic.co/t/how-to-use-suggest-from-java-api/11775/1 "2013-05-01T22:15:31Z")

</div>

Can anyone explain how to use the Java client to use the suggest querieslike  
this one:

{  
"suggest" : {  
"my-name" : {  
"text" : "And",  
"term" : {  
"size" : 3,  
"field" : "name"  
}  
}  
}  
}

The documentation for the client API does not describe how to use it.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [May 2, 2013, 2:29pm UTC](https://discuss.elastic.co/t/how-to-use-suggest-from-java-api/11775/2 "2013-05-02T14:29:18Z")

</div>

When in doubt of the Java API, look at the test cases:

[https://github.com/elasticsearch/elasticsearch/tree/master/src/test/java/org/elasticsearch/test/unit/action/suggest](https://github.com/elasticsearch/elasticsearch/tree/master/src/test/java/org/elasticsearch/test/unit/action/suggest)

[https://github.com/elasticsearch/elasticsearch/blob/master/src/test/java/org/elasticsearch/test/integration/search/suggest/SuggestSearchTests.java](https://github.com/elasticsearch/elasticsearch/blob/master/src/test/java/org/elasticsearch/test/integration/search/suggest/SuggestSearchTests.java)

--  
Ivan

On Wed, May 1, 2013 at 3:15 PM, Dan Liliedahl [dliliedahl@gmail.com](mailto:dliliedahl@gmail.com) wrote:

> Can anyone explain how to use the Java client to use the suggest querieslike  
> this one:
> 
> {  
> "suggest" : {  
> "my-name" : {  
> "text" : "And",  
> "term" : {  
> "size" : 3,  
> "field" : "name"  
> }  
> }  
> }  
> }
> 
> The documentation for the client API does not describe how to use it.
> 
> --  
> 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).  
> 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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:38am UTC](https://discuss.elastic.co/t/how-to-use-suggest-from-java-api/11775/3 "2017-07-06T02:38:40Z")

</div>


