Skip to content

Supporting dots ('.') as separator for dynamic_date_formats #10961

@gmoskovicz

Description

@gmoskovicz

dynamic_date_formats does don't support dots in mapping

Steps to repro

1- Modify default-mapping.json file and add

{
    "_default_" : {
        "dynamic_date_formats" : ["yyyy.MM.dd HH:mm"]
    }
}

2- Create new index and add a new document, without setting the mapping

{
    "my_date": "2012.03.08 12:30"
}

3- Verify that the my_date field is stored as string, and not as date

{
    "tryit_now": {
        "mappings": {
            "dateFormats": {
                "dynamic_date_formats": [
                    "yyyy.MM.dd HH:mm"
                ],
                "properties": {
                    "my_date": {
                        "type": "string"
                    }
                }
            }
        }
    }
}

According to the DocumentParser.java we only allow ":", "-" and "/" for separator for dynamic dates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions