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 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.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Modifier and TypeFieldDescriptionstatic org.elasticsearch.common.xcontent.ParseField
static org.elasticsearch.common.xcontent.ParseField
protected SortOrder
static org.elasticsearch.common.xcontent.ParseField
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract SortFieldAndFormat
build(SearchExecutionContext context)
Create a SortFieldAndFormat from this builder.abstract BucketedSort
buildBucketedSort(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 List<SortBuilder<?>>
fromXContent(org.elasticsearch.common.xcontent.XContentParser parser)
order()
Return theSortOrder
used for thisSortBuilder
.Set the order of sorting.protected static QueryBuilder
parseNestedFilter(org.elasticsearch.common.xcontent.XContentParser parser)
protected static IndexFieldData.XFieldComparatorSource.Nested
resolveNested(SearchExecutionContext context, String nestedPath, QueryBuilder nestedFilter)
protected static IndexFieldData.XFieldComparatorSource.Nested
resolveNested(SearchExecutionContext context, NestedSortBuilder nestedSort)
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableName
Methods inherited from interface org.elasticsearch.index.query.Rewriteable
rewrite
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContent
toXContent
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
Field Details
-
order
-
ORDER_FIELD
public static final org.elasticsearch.common.xcontent.ParseField ORDER_FIELD -
NESTED_FILTER_FIELD
public static final org.elasticsearch.common.xcontent.ParseField NESTED_FILTER_FIELD -
NESTED_PATH_FIELD
public static final org.elasticsearch.common.xcontent.ParseField NESTED_PATH_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 IOExceptionCreate a BucketedSort which is useful for sorting inside of aggregations.- Throws:
IOException
-
order
Set the order of sorting. -
order
Return theSortOrder
used for thisSortBuilder
. -
fromXContent
public static List<SortBuilder<?>> fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws IOException- Throws:
IOException
-
buildSort
public static Optional<SortAndFormats> buildSort(List<SortBuilder<?>> sortBuilders, SearchExecutionContext context) throws IOException- Throws:
IOException
-
resolveNested
protected static IndexFieldData.XFieldComparatorSource.Nested resolveNested(SearchExecutionContext context, String nestedPath, QueryBuilder nestedFilter) throws IOException- Throws:
IOException
-
resolveNested
protected static IndexFieldData.XFieldComparatorSource.Nested resolveNested(SearchExecutionContext context, NestedSortBuilder nestedSort) throws IOException- Throws:
IOException
-
parseNestedFilter
protected static QueryBuilder parseNestedFilter(org.elasticsearch.common.xcontent.XContentParser parser) -
toString
-