Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2335,12 +2335,16 @@ public void testNormsDisabledWhenIndexModeIsLogsDb() throws IOException {

public void testNormsDisabledWhenIndexModeIsTsdb() throws IOException {
// given
final boolean useSyntheticId = IndexSettings.TSDB_SYNTHETIC_ID_FEATURE_FLAG && randomBoolean();
Instant currentTime = Instant.now();
Settings.Builder indexSettingsBuilder = getIndexSettingsBuilder();
indexSettingsBuilder.put(IndexSettings.MODE.getKey(), IndexMode.TIME_SERIES.getName())
.put(IndexSettings.TIME_SERIES_START_TIME.getKey(), currentTime.minus(1, ChronoUnit.HOURS).toEpochMilli())
.put(IndexSettings.TIME_SERIES_END_TIME.getKey(), currentTime.plus(1, ChronoUnit.HOURS).toEpochMilli())
.put(IndexMetadata.INDEX_ROUTING_PATH.getKey(), "dimension");
if (IndexSettings.TSDB_SYNTHETIC_ID_FEATURE_FLAG) {
indexSettingsBuilder.put(IndexSettings.SYNTHETIC_ID.getKey(), useSyntheticId);
}
Settings indexSettings = indexSettingsBuilder.build();

XContentBuilder mapping = mapping(b -> {
Expand All @@ -2353,10 +2357,10 @@ public void testNormsDisabledWhenIndexModeIsTsdb() throws IOException {
b.endObject();
});

var source = source(TimeSeriesRoutingHashFieldMapper.DUMMY_ENCODED_VALUE, b -> {
var source = source(null, b -> {
b.field("@timestamp", Instant.now());
b.field("potato", "a potato flew around my room");
}, null);
}, TimeSeriesRoutingHashFieldMapper.DUMMY_ENCODED_VALUE);

// when
DocumentMapper mapper = createMapperService(indexSettings, mapping).documentMapper();
Expand Down