Skip to content

Commit

Permalink
Suggester: add suggestRequest to Requests and fix broken javadocs in …
Browse files Browse the repository at this point in the history
…client

closes #7206
  • Loading branch information
areek committed Aug 8, 2014
1 parent ef6d926 commit 2eb74c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Expand Up @@ -38,8 +38,8 @@
* A request to get suggestions for corrections of phrases. Best created with
* {@link org.elasticsearch.client.Requests#suggestRequest(String...)}.
* <p/>
* <p>The request requires the query source to be set either using {@link #query(org.elasticsearch.index.query.QueryBuilder)},
* or {@link #query(byte[])}.
* <p>The request requires the suggest query source to be set either using {@link #suggest(org.elasticsearch.common.bytes.BytesReference)},
* or {@link #suggest(org.elasticsearch.common.bytes.BytesReference, boolean)}.
*
* @see SuggestResponse
* @see org.elasticsearch.client.Client#suggest(SuggestRequest)
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/org/elasticsearch/client/Requests.java
Expand Up @@ -62,6 +62,7 @@
import org.elasticsearch.action.mlt.MoreLikeThisRequest;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchScrollRequest;
import org.elasticsearch.action.suggest.SuggestRequest;
import org.elasticsearch.common.xcontent.XContentType;

/**
Expand Down Expand Up @@ -162,6 +163,16 @@ public static ExistsRequest existsRequest(String... indices) {
return new ExistsRequest(indices);
}

/**
* Creates a suggest request for getting suggestions from provided <code>indices</code>.
* The suggest query has to be set using the JSON source using {@link org.elasticsearch.action.suggest.SuggestRequest#suggest(org.elasticsearch.common.bytes.BytesReference)}.
* @param indices The indices to suggest from. Use <tt>null</tt> or <tt>_all</tt> to execute against all indices
* @see org.elasticsearch.client.Client#suggest(org.elasticsearch.action.suggest.SuggestRequest)
*/
public static SuggestRequest suggestRequest(String... indices) {
return new SuggestRequest(indices);
}

/**
* More like this request represents a request to search for documents that are "like" the provided (fetched)
* document.
Expand Down

0 comments on commit 2eb74c0

Please sign in to comment.