Skip to content

Commit

Permalink
Register the _ts_routing_hash value format as named writeable
Browse files Browse the repository at this point in the history
  • Loading branch information
andreidan committed Sep 24, 2024
1 parent 6cdd59b commit fb7f789
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public class TimeSeriesRoutingHashFieldMapper extends MetadataFieldMapper {
public static final TypeParser PARSER = new FixedTypeParser(c -> c.getIndexSettings().getMode().timeSeriesRoutingHashFieldMapper());
static final NodeFeature TS_ROUTING_HASH_FIELD_PARSES_BYTES_REF = new NodeFeature("tsdb.ts_routing_hash_doc_value_parse_byte_ref");

static final class TimeSeriesRoutingHashFieldType extends MappedFieldType {
public static final class TimeSeriesRoutingHashFieldType extends MappedFieldType {

private static final TimeSeriesRoutingHashFieldType INSTANCE = new TimeSeriesRoutingHashFieldType();
private static final DocValueFormat DOC_VALUE_FORMAT = new DocValueFormat() {
public static final DocValueFormat DOC_VALUE_FORMAT = new DocValueFormat() {

@Override
public String getWriteableName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.core.RestApiVersion;
import org.elasticsearch.index.mapper.TimeSeriesRoutingHashFieldMapper;
import org.elasticsearch.index.mapper.TimeSeriesRoutingHashFieldMapper.TimeSeriesRoutingHashFieldType;
import org.elasticsearch.index.query.AbstractQueryBuilder;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.BoostingQueryBuilder;
Expand Down Expand Up @@ -1023,6 +1025,10 @@ private void registerValueFormats() {
registerValueFormat(DocValueFormat.BINARY.getWriteableName(), in -> DocValueFormat.BINARY);
registerValueFormat(DocValueFormat.UNSIGNED_LONG_SHIFTED.getWriteableName(), in -> DocValueFormat.UNSIGNED_LONG_SHIFTED);
registerValueFormat(DocValueFormat.TIME_SERIES_ID.getWriteableName(), in -> DocValueFormat.TIME_SERIES_ID);
registerValueFormat(
TimeSeriesRoutingHashFieldType.DOC_VALUE_FORMAT.getWriteableName(),
in -> TimeSeriesRoutingHashFieldType.DOC_VALUE_FORMAT
);
}

/**
Expand Down

0 comments on commit fb7f789

Please sign in to comment.