How I can to define date format in mapping that allow me to search on a date field by range in European and American formats like
[2010-08-11 TO 2010-08-30] or [08/11/2010 TO 08/30/2010]
I try to define date format like
"format":"yyyy-MM-dd||yyyy/MM/dd||MM/dd/yyyy"
But I got error when try to write document
{"error":"ReplicationShardOperationFailedException[[111111][4] ]; nested: MapperParsingException[Failed to parse [case.d
ate_created]]; nested: IllegalArgumentException[Invalid format: "2010/10/10" is too short]; "}
$ curl -XPUT 'http://localhost:9200/111111/OBJ/2' -d '
{
"case" : {
"title": "privet1",
"date_created" : "2010/10/10"
}
}'
It is working after that I delete American format definition from formats and format
"format":"yyyy-MM-dd||yyyy/MM/dd"
How I can to define date format in mapping that allow me to search on a
date
field by range in European and American formats like
[2010-08-11 TO 2010-08-30] or [08/11/2010 TO 08/30/2010]
I try to define date format like
"format":"yyyy-MM-dd||yyyy/MM/dd||MM/dd/yyyy"
But I got error when try to write document
{"error":"ReplicationShardOperationFailedException[[111111][4] ]; nested:
MapperParsingException[Failed to parse [case.d
ate_created]]; nested: IllegalArgumentException[Invalid format:
"2010/10/10" is too short]; "}
$ curl -XPUT 'http://localhost:9200/111111/OBJ/2' -d '
{
"case" : {
"title": "privet1",
"date_created" : "2010/10/10"
}
}'
It is working after that I delete American format definition from formats
and format
"format":"yyyy-MM-dd||yyyy/MM/dd"
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.