File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
server/src/main/java/org/elasticsearch/index/codec/tsdb/es819 Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 5454final class ES819TSDBDocValuesProducer extends DocValuesProducer {
5555 final IntObjectHashMap <NumericEntry > numerics ;
5656 private int primarySortFieldNumber = -1 ;
57+ private boolean primarySortFieldReversed = false ;
5758 final IntObjectHashMap <BinaryEntry > binaries ;
5859 final IntObjectHashMap <SortedEntry > sorted ;
5960 final IntObjectHashMap <SortedSetEntry > sortedSets ;
@@ -93,9 +94,13 @@ final class ES819TSDBDocValuesProducer extends DocValuesProducer {
9394
9495 readFields (in , state .fieldInfos );
9596 final var indexSort = state .segmentInfo .getIndexSort ();
96- if (indexSort != null ) {
97- var primaryField = indexSort .getSort ()[0 ];
98- primarySortFieldNumber = state .fieldInfos .fieldInfo (primaryField .getField ()).number ;
97+ if (indexSort != null && indexSort .getSort ().length > 0 ) {
98+ var primarySortField = indexSort .getSort ()[0 ];
99+ var sortField = state .fieldInfos .fieldInfo (primarySortField .getField ());
100+ if (sortField != null ) {
101+ primarySortFieldNumber = sortField .number ;
102+ primarySortFieldReversed = primarySortField .getReverse ();
103+ }
99104 }
100105 } catch (Throwable exception ) {
101106 priorE = exception ;
You can’t perform that action at this time.
0 commit comments