1

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 Answer 1

1

Refer to ES Docs

It should be

{
  "mappings": {
    "my_type": {
      "properties": {
        "dob": {
          "type":   "date",
          "format": "strict_date"
        }
      }
    }
  }
}
Sign up to request clarification or add additional context in comments.

5 Comments

Yes I have referred to the docs which include the code you posted but how would I go about adding the strict_date to it? @ChintanShah25
I edited my answer, what version of ES you are using?
Unfortunately that is still not working for me. I am running v 1.6.2 .. could this be the cause?
I think It only works in 2.0, It did not work for me on 1.7 and only 2.0 Doc seems to mention strict format
ahhhhh ok! Thank you so much :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.