public final class Search extends AsIsRiakCommand<SearchOperation.Response,BinaryValue>
To do a search in Riak, you must have search turned on, indexes created, and documents/objects indexed. Please see http://docs.basho.com/riak/latest/dev/using/search/ for more information. To use the Search class, you need a minimum of an Index to search, and a query to execute. Other options are available for pagination, sorting, filtering and what fields to return.
String index = "Author_Biographies";
String query = "name_s:Al* AND bio_tsd:awesome";
Search sch =
new Search.Builder(index, query).withRows(10).build();
SearchOperation.Response response = client.execute(sch);
All operations can called async as well.
...
RiakFuture<SearchOperation.Response, BinaryValue> future = client.executeAsync(sv);
...
future.await();
if (future.isSuccess())
{
...
}
Modifier and Type | Class and Description |
---|---|
static class |
Search.Builder
Builder for a Search command.
|
static class |
Search.Option<T> |
static class |
Search.Presort
Enum that encapsulates the possible settings for a search command's presort setting.
|
Constructor and Description |
---|
Search(Search.Builder builder) |
Modifier and Type | Method and Description |
---|---|
protected SearchOperation |
buildCoreOperation() |
executeAsync
execute, execute
public Search(Search.Builder builder)
protected SearchOperation buildCoreOperation()
buildCoreOperation
in class AsIsRiakCommand<SearchOperation.Response,BinaryValue>
Copyright © 2016. All rights reserved.