I was observing how date fields can be dynamically mapped.In my use case, fields that to be mapped as date are in epoch_millis format.
I have a dynamic template set for date field as :
While indexing a new field present in epoch_millis format within double quotes, this is considered as string.
{ "date_field1":"1536517800000" }
While indexing the same value in another new field present in same format(epoch_millis) without double quotes, this is considered as an integer and throws an mapper parsing exception
as this number is out of range of int.
{
"date_field2": 1536517800000
}
How do I ensure these values are taken as date rather than string and integer? Please note, I only receive values in epoch_millis format?
Could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.
A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.
However sometimes my field names may not always match a particular pattern.
Also, my other fields might match this pattern and might not actually contain a date.
How do I overcome these issues?
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.