Package org.elasticsearch.search.sort
Class SortBuilder<T extends SortBuilder<T>>
java.lang.Object
org.elasticsearch.search.sort.SortBuilder<T>
- All Implemented Interfaces:
NamedWriteable,Writeable,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentObject,Rewriteable<SortBuilder<?>>
- Direct Known Subclasses:
FieldSortBuilder,GeoDistanceSortBuilder,ScoreSortBuilder,ScriptSortBuilder
public abstract class SortBuilder<T extends SortBuilder<T>> extends java.lang.Object implements NamedWriteable, org.elasticsearch.common.xcontent.ToXContentObject, Rewriteable<SortBuilder<?>>
-
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.ParamsNested 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 org.elasticsearch.common.ParseFieldNESTED_FILTER_FIELDstatic org.elasticsearch.common.ParseFieldNESTED_PATH_FIELDprotected SortOrderorderstatic org.elasticsearch.common.ParseFieldORDER_FIELDFields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDSFields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
Constructors Constructor Description SortBuilder() -
Method Summary
Modifier and Type Method Description protected 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 java.util.Optional<SortAndFormats>buildSort(java.util.List<SortBuilder<?>> sortBuilders, SearchExecutionContext context)static java.util.List<SortBuilder<?>>fromXContent(org.elasticsearch.common.xcontent.XContentParser parser)SortOrderorder()Return theSortOrderused for thisSortBuilder.Torder(SortOrder order)Set the order of sorting.protected static QueryBuilderparseNestedFilter(org.elasticsearch.common.xcontent.XContentParser parser)protected static IndexFieldData.XFieldComparatorSource.NestedresolveNested(SearchExecutionContext context, java.lang.String nestedPath, QueryBuilder nestedFilter)protected static IndexFieldData.XFieldComparatorSource.NestedresolveNested(SearchExecutionContext context, NestedSortBuilder nestedSort)java.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableNameMethods inherited from interface org.elasticsearch.index.query.Rewriteable
rewriteMethods inherited from interface org.elasticsearch.common.xcontent.ToXContent
toXContentMethods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
Field Details
-
order
-
ORDER_FIELD
public static final org.elasticsearch.common.ParseField ORDER_FIELD -
NESTED_FILTER_FIELD
public static final org.elasticsearch.common.ParseField NESTED_FILTER_FIELD -
NESTED_PATH_FIELD
public static final org.elasticsearch.common.ParseField NESTED_PATH_FIELD
-
-
Constructor Details
-
SortBuilder
public SortBuilder()
-
-
Method Details
-
build
protected abstract SortFieldAndFormat build(SearchExecutionContext context) throws java.io.IOExceptionCreate a SortFieldAndFormat from this builder.- Throws:
java.io.IOException
-
buildBucketedSort
public abstract BucketedSort buildBucketedSort(SearchExecutionContext context, BigArrays bigArrays, int bucketSize, BucketedSort.ExtraData extra) throws java.io.IOExceptionCreate a BucketedSort which is useful for sorting inside of aggregations.- Throws:
java.io.IOException
-
order
Set the order of sorting. -
order
Return theSortOrderused for thisSortBuilder. -
fromXContent
public static java.util.List<SortBuilder<?>> fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException- Throws:
java.io.IOException
-
buildSort
public static java.util.Optional<SortAndFormats> buildSort(java.util.List<SortBuilder<?>> sortBuilders, SearchExecutionContext context) throws java.io.IOException- Throws:
java.io.IOException
-
resolveNested
protected static IndexFieldData.XFieldComparatorSource.Nested resolveNested(SearchExecutionContext context, java.lang.String nestedPath, QueryBuilder nestedFilter) throws java.io.IOException- Throws:
java.io.IOException
-
resolveNested
protected static IndexFieldData.XFieldComparatorSource.Nested resolveNested(SearchExecutionContext context, NestedSortBuilder nestedSort) throws java.io.IOException- Throws:
java.io.IOException
-
parseNestedFilter
protected static QueryBuilder parseNestedFilter(org.elasticsearch.common.xcontent.XContentParser parser) -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-