Module org.elasticsearch.server
Package org.elasticsearch.search.sort
Class SortBuilder<T extends SortBuilder<T>>
java.lang.Object
org.elasticsearch.search.sort.SortBuilder<T>
- All Implemented Interfaces:
NamedWriteable,VersionedNamedWriteable,Writeable,Rewriteable<SortBuilder<?>>,ToXContent,ToXContentObject
- Direct Known Subclasses:
FieldSortBuilder,GeoDistanceSortBuilder,ScoreSortBuilder,ScriptSortBuilder
public abstract class SortBuilder<T extends SortBuilder<T>>
extends Object
implements VersionedNamedWriteable, ToXContentObject, Rewriteable<SortBuilder<?>>
-
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 interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDSFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract SortFieldAndFormatbuild(SearchExecutionContext context) Create a SortFieldAndFormat from this builder.abstract BucketedSortbuildBucketedSort(SearchExecutionContext context, BigArrays bigArrays, int bucketSize, BucketedSort.ExtraData extra) Create a BucketedSort which is useful for sorting inside of aggregations.static Optional<SortAndFormats> buildSort(List<SortBuilder<?>> sortBuilders, SearchExecutionContext context) static Optional<SortAndFormats> buildSort(List<SortBuilder<?>> sortBuilders, SearchExecutionContext context, boolean optimize) static List<SortBuilder<?>> fromXContent(XContentParser parser) order()Return theSortOrderused for thisSortBuilder.Set the order of sorting.protected static QueryBuilderparseNestedFilter(XContentParser parser) protected static IndexFieldData.XFieldComparatorSource.NestedresolveNested(SearchExecutionContext context, NestedSortBuilder nestedSort) booleantoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.index.query.Rewriteable
rewriteMethods inherited from interface org.elasticsearch.xcontent.ToXContent
toXContentMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragmentMethods inherited from interface org.elasticsearch.common.io.stream.VersionedNamedWriteable
getMinimalSupportedVersion, getWriteableName, supportsVersion
-
Field Details
-
order
-
ORDER_FIELD
-
-
Constructor Details
-
SortBuilder
public SortBuilder()
-
-
Method Details
-
build
Create a SortFieldAndFormat from this builder.- Throws:
IOException
-
buildBucketedSort
public abstract BucketedSort buildBucketedSort(SearchExecutionContext context, BigArrays bigArrays, int bucketSize, BucketedSort.ExtraData extra) throws IOException Create a BucketedSort which is useful for sorting inside of aggregations.- Throws:
IOException
-
order
Set the order of sorting. -
order
Return theSortOrderused for thisSortBuilder. -
fromXContent
- Throws:
IOException
-
buildSort
public static Optional<SortAndFormats> buildSort(List<SortBuilder<?>> sortBuilders, SearchExecutionContext context) throws IOException - Throws:
IOException
-
buildSort
public static Optional<SortAndFormats> buildSort(List<SortBuilder<?>> sortBuilders, SearchExecutionContext context, boolean optimize) throws IOException - Throws:
IOException
-
resolveNested
protected static IndexFieldData.XFieldComparatorSource.Nested resolveNested(SearchExecutionContext context, NestedSortBuilder nestedSort) throws IOException - Throws:
IOException
-
parseNestedFilter
-
toString
-
supportsParallelCollection
public boolean supportsParallelCollection()
-