Skip to content

Allow number fields as routing fields? #95069

@martijnvg

Description

@martijnvg

This originated from the forum.

The following create index command fails, because the only routing field is a long and not keyword field:

PUT /temperature01
{
    "settings": {
        "index": {
            "mode": "time_series",
            "time_series": {
                "start_time": "2023-01-01T00:00:00Z",
                "end_time": "2023-01-03T23:59:59Z"
            },
            "routing_path": [
                "thermometer.id"
            ],
            "number_of_replicas": 0,
            "number_of_shards": 1
        }
    },
    "mappings": {
        "properties": {
            "@timestamp": {
                "type": "date"
            },
            "thermometer": {
                "properties": {
                    "id": {
                        "type": "long",
                        "time_series_dimension": true
                    },
                    "value": {
                        "type": "long",
                        "time_series_metric": "gauge"
                    }
                }
            }
        }
    }
}

The question is whether this restriction can be lifted. E.g. in this case could the id just be converted to a string and then route by that? It is a little bit confusing that a long field can be dimension, but not a dimension that is used for routing.

Note that it is documented that routing_path needs to be a plain keyword field: https://www.elastic.co/guide/en/elasticsearch/reference/8.7/tsds.html#dimension-based-routing

Metadata

Metadata

Assignees

No one assigned

    Labels

    :StorageEngine/TSDBYou know, for MetricsTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions