Package org.elasticsearch.index
Class IndexSortConfig
- java.lang.Object
-
- org.elasticsearch.index.IndexSortConfig
-
public final class IndexSortConfig extends Object
Holds all the information that is used to build the sort order of an index. The index sort settings are final and can be defined only at index creation. These settings are divided in four lists that are merged during the initialization of this class:- `index.sort.field`: the field or a list of field to use for the sort
- `index.sort.order` the
SortOrderto use for the field or a list ofSortOrderfor each field defined in `index.sort.field`. - `index.sort.mode`: the
MultiValueModeto use for the field or a list of orders for each field defined in `index.sort.field`. - `index.sort.missing`: the missing value to use for the field or a list of missing values for each field defined in `index.sort.field`
-
-
Field Summary
Fields Modifier and Type Field Description static Setting<List<String>>INDEX_SORT_FIELD_SETTINGThe list of field namesstatic Setting<List<String>>INDEX_SORT_MISSING_SETTINGThe missing value for each specified sort field (ie.static Setting<List<MultiValueMode>>INDEX_SORT_MODE_SETTINGTheMultiValueModefor each specified sort field (ie.static Setting<List<SortOrder>>INDEX_SORT_ORDER_SETTINGTheSortOrderfor each specified sort field (ie.
-
Constructor Summary
Constructors Constructor Description IndexSortConfig(IndexSettings indexSettings)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SortbuildIndexSort(Function<String,MappedFieldType> fieldTypeLookup, Function<MappedFieldType,IndexFieldData<?>> fieldDataLookup)Builds theSortorder from the settings for this index or returns null if this index has no sort.static SortField.TypegetSortFieldType(SortField sortField)booleanhasIndexSort()Returns true if the index should be sorted
-
-
-
Field Detail
-
INDEX_SORT_FIELD_SETTING
public static final Setting<List<String>> INDEX_SORT_FIELD_SETTING
The list of field names
-
INDEX_SORT_ORDER_SETTING
public static final Setting<List<SortOrder>> INDEX_SORT_ORDER_SETTING
TheSortOrderfor each specified sort field (ie. asc or desc).
-
INDEX_SORT_MODE_SETTING
public static final Setting<List<MultiValueMode>> INDEX_SORT_MODE_SETTING
TheMultiValueModefor each specified sort field (ie. max or min).
-
-
Constructor Detail
-
IndexSortConfig
public IndexSortConfig(IndexSettings indexSettings)
-
-
Method Detail
-
hasIndexSort
public boolean hasIndexSort()
Returns true if the index should be sorted
-
buildIndexSort
public Sort buildIndexSort(Function<String,MappedFieldType> fieldTypeLookup, Function<MappedFieldType,IndexFieldData<?>> fieldDataLookup)
Builds theSortorder from the settings for this index or returns null if this index has no sort.
-
getSortFieldType
public static SortField.Type getSortFieldType(SortField sortField)
-
-