I am putting in custom templates to take the guess work out of the mappings generated. The indices are created daily and collect logs. I took the mapping of one of the created index and then added the dynamic template section in it. Then I posted it back into the elasticsearch. Should I have removed the sections which would now be handled by dynamic template?
Details
The field is Result.NumericValue
Now it can have say 34 as well as 67.56. Depending on the contents of the first log of the day, Result.NumericValue would get mapped as a long or a double. If it gets mapped as long then it rejects the values like 67.56.
Should I remove them before pushing it in elasticsearch. Till now I have refrained from doing so. Does it make a difference? Or does dynamic template has higher precedence?
If Result.NumericValue comes with a value 34.65 then based on above template, elasticsearch will reject it because mapping in template has the precedence over the dynamic template section of it. Right?
Despite a dynamic template section which would have mapped this as a float.
Sorry for late reply. And I am bit confused now. I am able to put both 34 and 34.34 in the index using this mapping !! Should it not have refused 34.34 ??
POST foo/_doc/
{
"value" : 34
}
POST foo/_doc/
{
"value" : 34.34
}
GET foo/_search
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.