Package org.elasticsearch.search.sort
Class ScoreSortBuilder
- java.lang.Object
-
- org.elasticsearch.search.sort.SortBuilder<ScoreSortBuilder>
-
- org.elasticsearch.search.sort.ScoreSortBuilder
-
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentObject,Rewriteable<SortBuilder<?>>
public class ScoreSortBuilder extends SortBuilder<ScoreSortBuilder>
A sort builder allowing to sort by score.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNAME-
Fields inherited from class org.elasticsearch.search.sort.SortBuilder
NESTED_FILTER_FIELD, NESTED_PATH_FIELD, order, ORDER_FIELD
-
Fields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDS
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description ScoreSortBuilder()Build a ScoreSortBuilder default to descending sort order.ScoreSortBuilder(StreamInput in)Read from a stream.
-
Method Summary
Modifier and Type Method Description SortFieldAndFormatbuild(QueryShardContext context)Create a @linkSortFieldAndFormatfrom this builder.booleanequals(java.lang.Object object)static ScoreSortBuilderfromXContent(XContentParser parser, java.lang.String fieldName)java.lang.StringgetWriteableName()Returns the name of the writeable objectinthashCode()ScoreSortBuilderrewrite(QueryRewriteContext ctx)Rewrites this instance based on the provided context.XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)voidwriteTo(StreamOutput out)Write this into the StreamOutput.-
Methods inherited from class org.elasticsearch.search.sort.SortBuilder
buildSort, fromXContent, order, order, parseNestedFilter, resolveNested, resolveNested, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ScoreSortBuilder
public ScoreSortBuilder()
Build a ScoreSortBuilder default to descending sort order.
-
ScoreSortBuilder
public ScoreSortBuilder(StreamInput in) throws java.io.IOException
Read from a stream.- Throws:
java.io.IOException
-
-
Method Detail
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:WriteableWrite this into the StreamOutput.- Throws:
java.io.IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Throws:
java.io.IOException
-
fromXContent
public static ScoreSortBuilder fromXContent(XContentParser parser, java.lang.String fieldName)
- Parameters:
parser- the input parser. The state on the parser contained in this context will be changed as a side effect of this method callfieldName- in some sort syntax variations the field name precedes the xContent object that specifies further parameters, e.g. in '{ "foo": { "order" : "asc"} }'. When parsing the inner object, the field name can be passed in via this argument
-
build
public SortFieldAndFormat build(QueryShardContext context)
Description copied from class:SortBuilderCreate a @linkSortFieldAndFormatfrom this builder.- Specified by:
buildin classSortBuilder<ScoreSortBuilder>
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getWriteableName
public java.lang.String getWriteableName()
Description copied from interface:NamedWriteableReturns the name of the writeable object
-
rewrite
public ScoreSortBuilder rewrite(QueryRewriteContext ctx) throws java.io.IOException
Description copied from interface:RewriteableRewrites this instance based on the provided context. The returned objects will be the same instance as this if no changes during the rewrite were applied.- Throws:
java.io.IOException
-
-