java.lang.Object
org.elasticsearch.search.sort.SortBuilder<ScoreSortBuilder>
org.elasticsearch.search.sort.ScoreSortBuilder
- All Implemented Interfaces:
NamedWriteable,VersionedNamedWriteable,Writeable,Rewriteable<SortBuilder<?>>,ToXContent,ToXContentObject
A sort builder allowing to sort by score.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from class org.elasticsearch.search.sort.SortBuilder
order, ORDER_FIELDFields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDSFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionBuild a ScoreSortBuilder default to descending sort order.Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionbuild(SearchExecutionContext context) Create a SortFieldAndFormat from this builder.buildBucketedSort(SearchExecutionContext context, BigArrays bigArrays, int bucketSize, BucketedSort.ExtraData extra) Create a BucketedSort which is useful for sorting inside of aggregations.booleanstatic ScoreSortBuilderfromXContent(XContentParser parser, String fieldName) The minimal version of the recipient this object can be sent to.Returns the name of the writeable objectinthashCode()Rewrites this instance based on the provided context.toXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.search.sort.SortBuilder
buildSort, buildSort, fromXContent, order, order, parseNestedFilter, resolveNested, supportsParallelCollection, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragmentMethods inherited from interface org.elasticsearch.common.io.stream.VersionedNamedWriteable
supportsVersion
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
ScoreSortBuilder
public ScoreSortBuilder()Build a ScoreSortBuilder default to descending sort order. -
ScoreSortBuilder
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Throws:
IOException
-
fromXContent
- 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
Description copied from class:SortBuilderCreate a SortFieldAndFormat from this builder.- Specified by:
buildin classSortBuilder<ScoreSortBuilder>
-
buildBucketedSort
public BucketedSort buildBucketedSort(SearchExecutionContext context, BigArrays bigArrays, int bucketSize, BucketedSort.ExtraData extra) Description copied from class:SortBuilderCreate a BucketedSort which is useful for sorting inside of aggregations.- Specified by:
buildBucketedSortin classSortBuilder<ScoreSortBuilder>
-
equals
-
hashCode
public int hashCode() -
getWriteableName
Description copied from interface:VersionedNamedWriteableReturns the name of the writeable object -
getMinimalSupportedVersion
Description copied from interface:VersionedNamedWriteableThe minimal version of the recipient this object can be sent to. SeeVersionedNamedWriteable.supportsVersion(TransportVersion)for the default serialization check. -
rewrite
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.
-