@@ -156,6 +156,7 @@ public void testUseEs812PostingsFormat() throws IOException {
156156 public void testUseES87TSDBEncodingForTimestampField () throws IOException {
157157 PerFieldFormatSupplier perFieldMapperCodec = createFormatSupplier (true , true , true );
158158 assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat ("@timestamp" )), is (true ));
159+ assertThat ((perFieldMapperCodec .useLogsDocValuesFormat ("@timestamp" )), is (false ));
159160 }
160161
161162 public void testDoNotUseES87TSDBEncodingForTimestampFieldNonTimeSeriesIndex () throws IOException {
@@ -167,6 +168,8 @@ public void testEnableES87TSDBCodec() throws IOException {
167168 PerFieldFormatSupplier perFieldMapperCodec = createFormatSupplier (true , false , IndexMode .TIME_SERIES , MAPPING_1 );
168169 assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat ("gauge" )), is (true ));
169170 assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat ("@timestamp" )), is (true ));
171+ assertThat ((perFieldMapperCodec .useLogsDocValuesFormat ("gauge" )), is (false ));
172+ assertThat ((perFieldMapperCodec .useLogsDocValuesFormat ("@timestamp" )), is (false ));
170173 }
171174
172175 public void testDisableES87TSDBCodec () throws IOException {
@@ -223,34 +226,46 @@ public void testUseTimeSeriesDocValuesCodecSetting() throws IOException {
223226 assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat ("@timestamp" )), is (true ));
224227 assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat ("counter" )), is (true ));
225228 assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat ("gauge" )), is (true ));
229+ assertThat ((perFieldMapperCodec .useLogsDocValuesFormat ("@timestamp" )), is (false ));
230+ assertThat ((perFieldMapperCodec .useLogsDocValuesFormat ("counter" )), is (false ));
231+ assertThat ((perFieldMapperCodec .useLogsDocValuesFormat ("gauge" )), is (false ));
226232 }
227233
228234 public void testUseTimeSeriesModeAndCodecEnabled () throws IOException {
229235 PerFieldFormatSupplier perFieldMapperCodec = createFormatSupplier (true , false , IndexMode .TIME_SERIES , MAPPING_2 );
230236 assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat ("@timestamp" )), is (true ));
231237 assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat ("counter" )), is (true ));
232238 assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat ("gauge" )), is (true ));
239+ assertThat ((perFieldMapperCodec .useLogsDocValuesFormat ("@timestamp" )), is (false ));
240+ assertThat ((perFieldMapperCodec .useLogsDocValuesFormat ("counter" )), is (false ));
241+ assertThat ((perFieldMapperCodec .useLogsDocValuesFormat ("gauge" )), is (false ));
233242 }
234243
235244 public void testLogsIndexMode () throws IOException {
236245 PerFieldFormatSupplier perFieldMapperCodec = createFormatSupplier (IndexMode .LOGSDB , MAPPING_3 );
237- assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat ("@timestamp" )), is (true ));
238- assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat ("hostname" )), is (true ));
239- assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat ("response_size" )), is (true ));
246+ assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat ("@timestamp" )), is (false ));
247+ assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat ("hostname" )), is (false ));
248+ assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat ("response_size" )), is (false ));
249+ assertThat ((perFieldMapperCodec .useLogsDocValuesFormat ("@timestamp" )), is (true ));
250+ assertThat ((perFieldMapperCodec .useLogsDocValuesFormat ("hostname" )), is (true ));
251+ assertThat ((perFieldMapperCodec .useLogsDocValuesFormat ("response_size" )), is (true ));
240252 }
241253
242254 public void testMetaFields () throws IOException {
243255 PerFieldFormatSupplier perFieldMapperCodec = createFormatSupplier (IndexMode .LOGSDB , MAPPING_3 );
244- assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat (TimeSeriesIdFieldMapper .NAME )), is (true ));
245- assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat (TimeSeriesRoutingHashFieldMapper .NAME )), is (true ));
256+ assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat (TimeSeriesIdFieldMapper .NAME )), is (false ));
257+ assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat (TimeSeriesRoutingHashFieldMapper .NAME )), is (false ));
258+ assertThat ((perFieldMapperCodec .useLogsDocValuesFormat (TimeSeriesIdFieldMapper .NAME )), is (true ));
259+ assertThat ((perFieldMapperCodec .useLogsDocValuesFormat (TimeSeriesRoutingHashFieldMapper .NAME )), is (true ));
246260 // See: PerFieldFormatSupplier why these fields shouldn't use tsdb codec
247261 assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat (SourceFieldMapper .RECOVERY_SOURCE_NAME )), is (false ));
248262 assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat (SourceFieldMapper .RECOVERY_SOURCE_SIZE_NAME )), is (false ));
249263 }
250264
251265 public void testSeqnoField () throws IOException {
252266 PerFieldFormatSupplier perFieldMapperCodec = createFormatSupplier (IndexMode .LOGSDB , MAPPING_3 );
253- assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat (SeqNoFieldMapper .NAME )), is (true ));
267+ assertThat ((perFieldMapperCodec .useTSDBDocValuesFormat (SeqNoFieldMapper .NAME )), is (false ));
268+ assertThat ((perFieldMapperCodec .useLogsDocValuesFormat (SeqNoFieldMapper .NAME )), is (true ));
254269 }
255270
256271 private PerFieldFormatSupplier createFormatSupplier (IndexMode mode , String mapping ) throws IOException {
0 commit comments