Package org.elasticsearch.index
Class IndexSortConfig
org.elasticsearch.index.IndexSortConfig
public final class IndexSortConfig
extends
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
SortOrder
to use for the field or a list ofSortOrder
for each field defined in `index.sort.field`. - `index.sort.mode`: the
MultiValueMode
to 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
Modifier and TypeFieldDescriptionstatic <>>
The list of field namesstatic <>>
The missing value for each specified sort field (ie.static <MultiValueMode>>
TheMultiValueMode
for each specified sort field (ie.static <SortOrder>>
TheSortOrder
for each specified sort field (ie. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.search.Sort
<,MappedFieldType> fieldTypeLookup, <<SearchLookup>,IndexFieldData<?>> fieldDataLookup)
Builds theSort
order from the settings for this index or returns null if this index has no sort.static org.apache.lucene.search.SortField.Type
getSortFieldType(org.apache.lucene.search.SortField sortField)
boolean
Returns true if the index should be sortedboolean
field)
Methods inherited from class java.lang.
, , , , , , , , , ,
-
Field Details
-
INDEX_SORT_FIELD_SETTING
public static final <>> INDEX_SORT_FIELD_SETTINGThe list of field names -
INDEX_SORT_ORDER_SETTING
TheSortOrder
for each specified sort field (ie. asc or desc). -
INDEX_SORT_MODE_SETTING
TheMultiValueMode
for each specified sort field (ie. max or min). -
INDEX_SORT_MISSING_SETTING
public static final <>> INDEX_SORT_MISSING_SETTINGThe missing value for each specified sort field (ie. _first or _last)
-
-
Constructor Details
-
IndexSortConfig
-
-
Method Details
-
hasIndexSort
public boolean hasIndexSort()Returns true if the index should be sorted -
hasPrimarySortOnField
public boolean hasPrimarySortOnField( field) -
buildIndexSort
public org.apache.lucene.search.Sort buildIndexSort(<,MappedFieldType> fieldTypeLookup, <<SearchLookup>,IndexFieldData<?>> fieldDataLookup)Builds theSort
order from the settings for this index or returns null if this index has no sort. -
getSortFieldType
public static org.apache.lucene.search.SortField.Type getSortFieldType(org.apache.lucene.search.SortField sortField)
-