public static class Suggest.Suggestion<T extends Suggest.Suggestion.Entry> extends Object implements Iterable<T>, Streamable, ToXContent
Modifier and Type | Class and Description |
---|---|
static class |
Suggest.Suggestion.Entry<O extends Suggest.Suggestion.Entry.Option>
Represents a part from the suggest text with suggested options.
|
static class |
Suggest.Suggestion.Sort |
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
protected List<T> |
entries |
protected String |
name |
protected int |
size |
static int |
TYPE |
EMPTY_PARAMS
Constructor and Description |
---|
Suggest.Suggestion() |
Suggest.Suggestion(String name,
int size) |
Modifier and Type | Method and Description |
---|---|
void |
addTerm(T entry) |
List<T> |
getEntries() |
String |
getName() |
int |
getType() |
protected void |
innerReadFrom(StreamInput in) |
void |
innerWriteTo(StreamOutput out) |
Iterator<T> |
iterator() |
protected T |
newEntry() |
void |
readFrom(StreamInput in) |
Suggest.Suggestion<T> |
reduce(List<Suggest.Suggestion<T>> toReduce)
Merges the result of another suggestion into this suggestion.
|
protected Comparator<Suggest.Suggestion.Entry.Option> |
sortComparator() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
trim()
Trims the number of options per suggest text term to the requested size.
|
void |
writeTo(StreamOutput out) |
public static final int TYPE
protected String name
protected int size
protected final List<T extends Suggest.Suggestion.Entry> entries
public Suggest.Suggestion()
public Suggest.Suggestion(String name, int size)
public void addTerm(T entry)
public int getType()
public Iterator<T> iterator()
iterator
in interface Iterable<T extends Suggest.Suggestion.Entry>
public String getName()
public Suggest.Suggestion<T> reduce(List<Suggest.Suggestion<T>> toReduce)
protected Comparator<Suggest.Suggestion.Entry.Option> sortComparator()
public void trim()
public void readFrom(StreamInput in) throws IOException
readFrom
in interface Streamable
IOException
protected T newEntry()
protected void innerReadFrom(StreamInput in) throws IOException
IOException
public void writeTo(StreamOutput out) throws IOException
writeTo
in interface Streamable
IOException
public void innerWriteTo(StreamOutput out) throws IOException
IOException
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
toXContent
in interface ToXContent
IOException
Copyright © 2009–2016. All rights reserved.