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
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentObject
,Rewriteable<SortBuilder<?>>
A sort builder allowing to sort by score.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
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
ConstructorDescriptionBuild 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.boolean
static ScoreSortBuilder
fromXContent(org.elasticsearch.common.xcontent.XContentParser parser, String fieldName)
Returns the name of the writeable objectint
hashCode()
Rewrites this instance based on the provided context.org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
void
writeTo(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 Details
-
NAME
- See Also:
- Constant Field Values
-
-
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:Writeable
Write this into the StreamOutput.- Throws:
IOException
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Throws:
IOException
-
fromXContent
public static ScoreSortBuilder fromXContent(org.elasticsearch.common.xcontent.XContentParser parser, 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
Description copied from class:SortBuilder
Create a SortFieldAndFormat from this builder.- Specified by:
build
in classSortBuilder<ScoreSortBuilder>
-
buildBucketedSort
public BucketedSort buildBucketedSort(SearchExecutionContext context, BigArrays bigArrays, int bucketSize, BucketedSort.ExtraData extra) throws IOExceptionDescription copied from class:SortBuilder
Create a BucketedSort which is useful for sorting inside of aggregations.- Specified by:
buildBucketedSort
in classSortBuilder<ScoreSortBuilder>
- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
getWriteableName
Description copied from interface:NamedWriteable
Returns the name of the writeable object -
rewrite
Description copied from interface:Rewriteable
Rewrites 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:
IOException
-