@@ -1030,9 +1030,10 @@ private DateFieldMapper(
10301030 * Determines whether the doc values skipper (sparse index) should be used for the {@code @timestamp} field.
10311031 * <p>
10321032 * The doc values skipper is enabled only if {@code index.mapping.use_doc_values_skipper} is set to {@code true},
1033- * the index was created on or after {@link IndexVersions#TIMESTAMP_DOC_VALUES_SPARSE_INDEX}, and the
1034- * field has doc values enabled. Additionally, the index mode must be {@link IndexMode#LOGSDB}, and
1035- * the index sorting configuration must include the {@code @timestamp} field.
1033+ * the index was created on or after {@link IndexVersions#TIMESTAMP_DOC_VALUES_SPARSE_INDEX}
1034+ * ({@link IndexVersions#TSDB_TIMESTAMP_DOC_VALUES_SPARSE_INDEX} for time-series indices), and the
1035+ * field has doc values enabled. Additionally, the index mode must be {@link IndexMode#LOGSDB} or {@link IndexMode#TIME_SERIES}, and for
1036+ * logsdb indices the index sorting configuration must include the {@code @timestamp} field.
10361037 *
10371038 * @param indexCreatedVersion The version of the index when it was created.
10381039 * @param useDocValuesSkipper Whether the doc values skipper feature is enabled via the {@code index.mapping.use_doc_values_skipper}
@@ -1052,13 +1053,21 @@ private static boolean shouldUseDocValuesSkipper(
10521053 final IndexSortConfig indexSortConfig ,
10531054 final String fullFieldName
10541055 ) {
1055- return indexCreatedVersion .onOrAfter (IndexVersions .TIMESTAMP_DOC_VALUES_SPARSE_INDEX )
1056- && useDocValuesSkipper
1057- && hasDocValues
1058- && IndexMode .LOGSDB .equals (indexMode )
1059- && indexSortConfig != null
1060- && indexSortConfig .hasSortOnField (fullFieldName )
1061- && DataStreamTimestampFieldMapper .DEFAULT_PATH .equals (fullFieldName );
1056+ if (IndexMode .LOGSDB .equals (indexMode )) {
1057+ return indexCreatedVersion .onOrAfter (IndexVersions .TIMESTAMP_DOC_VALUES_SPARSE_INDEX )
1058+ && useDocValuesSkipper
1059+ && hasDocValues
1060+ && indexSortConfig != null
1061+ && indexSortConfig .hasSortOnField (fullFieldName )
1062+ && DataStreamTimestampFieldMapper .DEFAULT_PATH .equals (fullFieldName );
1063+ } else if (IndexMode .TIME_SERIES .equals (indexMode )) {
1064+ return indexCreatedVersion .onOrAfter (IndexVersions .TSDB_TIMESTAMP_DOC_VALUES_SPARSE_INDEX )
1065+ && useDocValuesSkipper
1066+ && hasDocValues
1067+ && DataStreamTimestampFieldMapper .DEFAULT_PATH .equals (fullFieldName );
1068+ } else {
1069+ return false ;
1070+ }
10621071 }
10631072
10641073 @ Override
0 commit comments