public abstract static class SuggestBuilder.SuggestionBuilder<T> extends ToXContentToBytes
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
EMPTY_PARAMS
Constructor and Description |
---|
SuggestBuilder.SuggestionBuilder(String name,
String suggester) |
Modifier and Type | Method and Description |
---|---|
T |
addCategory(String name,
CharSequence... categories)
Setup a Category for suggestions.
|
T |
addCategory(String name,
Iterable<? extends CharSequence> categories)
Setup a Category for suggestions.
|
T |
addContextField(String name,
CharSequence... fieldvalues)
Setup a Context Field for suggestions.
|
T |
addContextField(String name,
Iterable<? extends CharSequence> fieldvalues)
Setup a Context Field for suggestions.
|
T |
addGeoLocation(String name,
double lat,
double lon,
int... precisions)
Setup a Geolocation for suggestions.
|
T |
addGeoLocation(String name,
String geohash)
Setup a Geolocation for suggestions.
|
T |
addGeoLocationWithPrecision(String name,
double lat,
double lon,
String... precisions)
Setup a Geolocation for suggestions.
|
T |
analyzer(String analyzer)
Sets the analyzer to analyse to suggest text with.
|
T |
field(String field)
Sets from what field to fetch the candidate suggestions from.
|
protected abstract XContentBuilder |
innerToXContent(XContentBuilder builder,
ToXContent.Params params) |
T |
shardSize(Integer shardSize)
Sets the maximum number of suggested term to be retrieved from each
individual shard.
|
T |
size(int size)
Sets the maximum suggestions to be returned per suggest text term.
|
T |
text(String text)
Same as in
SuggestBuilder.setText(String) , but in the suggestion scope. |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
buildAsBytes, buildAsBytes, toString
public T addGeoLocation(String name, double lat, double lon, int... precisions)
GeolocationContextMapping
.lat
- Latitude of the locationlon
- Longitude of the Locationpublic T addGeoLocationWithPrecision(String name, double lat, double lon, String... precisions)
GeolocationContextMapping
.lat
- Latitude of the locationlon
- Longitude of the Locationprecisions
- precisions as string var-argspublic T addGeoLocation(String name, String geohash)
GeolocationContextMapping
.geohash
- Geohash of the locationpublic T addCategory(String name, CharSequence... categories)
CategoryContextMapping
.categories
- name of the categorypublic T addCategory(String name, Iterable<? extends CharSequence> categories)
CategoryContextMapping
.categories
- name of the categorypublic T addContextField(String name, CharSequence... fieldvalues)
CategoryContextMapping
.fieldvalues
- name of the categorypublic T addContextField(String name, Iterable<? extends CharSequence> fieldvalues)
CategoryContextMapping
.fieldvalues
- name of the categorypublic T text(String text)
SuggestBuilder.setText(String)
, but in the suggestion scope.public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
IOException
protected abstract XContentBuilder innerToXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
IOException
public T field(String field)
field(String)
methodpublic T analyzer(String analyzer)
public T size(int size)
public T shardSize(Integer shardSize)
size
option. Defaults to the
size
option.
Setting this to a value higher than the `size` can be useful in order to get a more accurate document frequency for suggested terms. Due to the fact that terms are partitioned amongst shards, the shard level document frequencies of suggestions may not be precise. Increasing this will make these document frequencies more precise.
Copyright © 2009–2016. All rights reserved.