I am developing a command which reads the file and stores data in mongoDB database. For search instance I'm using elastic search. I have used exercise/elastica-bundle for that.
When I create mapping for index, I'm getting error for "dob" field.
MapperParsingException[failed to parse [dob]];
nested: MapperParsingException[failed to parse date field [], tried both date
format [dateOptionalTime], and timestamp number with locale [null]]; nested:
IllegalArgumentException[Invalid format: ""];
This is my mapping in config.yml file:
person:
mappings:
name: { index: not_analyzed }
title: { index: not_analyzed }
dob: { index: not_analyzed }
position: { index: not_analyzed }
address: { index: not_analyzed }
postCode: { index: not_analyzed }
country: { index: not_analyzed }
otherInformation: { index: not_analyzed }
persistence:
driver: mongodb
model: MDM\MainBundle\Document\Person
provider: ~
listener: ~
finder: ~
If I provide,
dob: { type: date, format: "yyyy-mm-dd", index: not_analyzed }
It gives me error,
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
Unrecognized options "format" under "foq_elastica.indexes.storage.types.list.mappings.dob"
EDIT: I have not found any solution yet, But for now I did this
dob: { type: string, index: not_analyzed }
and now I can make entry in my elastic index.