Constructor and Description |
---|
Builder(String index,
String query)
Construct a Builder for a Search command.
|
Modifier and Type | Method and Description |
---|---|
Search |
build()
Construct the Search command.
|
Search.Builder |
filter(String query)
Set a filter to use for this search.
|
Search.Builder |
returnFields(Iterable<String> fields)
Set the list of fields that should be returned for each record in the result set.
|
Search.Builder |
returnFields(String... fields)
Set the list of fields that should be returned for each record in the result set.
|
Search.Builder |
sort(String field)
Set a field to sort the results on.
|
<T> Search.Builder |
withOption(Search.Option<T> option,
T value)
Add an optional setting for this command.
|
Search.Builder |
withPresort(Search.Presort presort)
Set the presort option, you may presort the results by Key or Score.
|
Search.Builder |
withRows(int rows)
Set the maximum number of rows to return.
|
Search.Builder |
withStart(int start)
Set the starting row to return.
|
public Search.Builder withPresort(Search.Presort presort)
presort
- the Search.Presort
option to set.public Search.Builder withStart(int start)
start
- the first row to return out of the result set.
Use in conjunction with withRows(int)
to paginate the results.public Search.Builder withRows(int rows)
rows
- The total number of rows to return.
Use in conjunction with withStart(int)
to paginate the results.public <T> Search.Builder withOption(Search.Option<T> option, T value)
option
- the option.value
- the value for the option.public Search.Builder filter(String query)
query
- the query string to filter the search with.public Search.Builder sort(String field)
field
- the field to sort the results with.public Search.Builder returnFields(Iterable<String> fields)
fields
- the collection of fields to return with each result.public Search.Builder returnFields(String... fields)
fields
- the varargs list of fields to return with each result.public Search build()
Copyright © 2016. All rights reserved.