public class FieldSortBuilder extends SortBuilder
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
EMPTY_PARAMS
Constructor and Description |
---|
FieldSortBuilder(String fieldName)
Constructs a new sort based on a document field.
|
Modifier and Type | Method and Description |
---|---|
FieldSortBuilder |
ignoreUnmapped(boolean ignoreUnmapped)
Deprecated.
Use
unmappedType(String) instead. |
FieldSortBuilder |
missing(Object missing)
Sets the value when a field is missing in a doc.
|
FieldSortBuilder |
order(SortOrder order)
The order of sorting.
|
FieldSortBuilder |
setNestedFilter(QueryBuilder nestedFilter)
Sets the nested filter that the nested objects should match with in order to be taken into account
for sorting.
|
FieldSortBuilder |
setNestedPath(String nestedPath)
Sets the nested path if sorting occurs on a field that is inside a nested object.
|
FieldSortBuilder |
sortMode(String sortMode)
Defines what values to pick in the case a document contains multiple values for the targeted sort field.
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
FieldSortBuilder |
unmappedType(String type)
Set the type to use in case the current field is not mapped in an index.
|
toString
public FieldSortBuilder(String fieldName)
fieldName
- The field name.public FieldSortBuilder order(SortOrder order)
SortOrder.ASC
.order
in class SortBuilder
public FieldSortBuilder missing(Object missing)
missing
in class SortBuilder
@Deprecated public FieldSortBuilder ignoreUnmapped(boolean ignoreUnmapped)
unmappedType(String)
instead.public FieldSortBuilder unmappedType(String type)
public FieldSortBuilder sortMode(String sortMode)
The last two values are only applicable for number based fields.
public FieldSortBuilder setNestedFilter(QueryBuilder nestedFilter)
public FieldSortBuilder setNestedPath(String nestedPath)
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
IOException
Copyright © 2009–2016. All rights reserved.