1
votes

I am trying to use the strict_date formatter within ElasticSearch which is a a formatter for a full date as four digit year, two digit month of year, and two digit day of month: yyyy-MM-dd.

I am using the following code in Marvel:

PUT my_strictindex
{
  "mappings": {
    "my_type": {
      "properties": {
        "dob": {
          "type": "strict_date"
        }
      }
    }
  }
}

I get the following error:

{ "error": "MapperParsingException[mapping [my_type]]; nested: MapperParsingException[No handler for type [strict_date] declared on field [dob]]; ", "status": 400 }

Any help would be appreciated!

1

1 Answers

1
votes

Refer to ES Docs

It should be

{
  "mappings": {
    "my_type": {
      "properties": {
        "dob": {
          "type":   "date",
          "format": "strict_date"
        }
      }
    }
  }
}