Make sure the template does match. This might not be always obvious however it's easy to test out. First, check your
template and after defining the template, send a request with a sample payload to see whether the doc gets properly
created. A common mistake is defining the template after the index is created which makes it useless; the template gets
applied when a the index is created (and thus it becomes part of its mapping).
Second, if the mapping appears correct, double-check your es-hadoop configuration and potentially turn on logging to see
the payload sent by es-hadoop to elasticsearch.
Hope this helps,
On 7/1/14 11:09 PM, Telax wrote:
Hello,
I'm interested in using the EsOutputFormat class in a hadoop mapreduce task.
During experimentation I have noticed that there is no direct handling for
'date' objects.
My data contains a number of 'date' fields which must be transposed into the
Elasticsearch index, however, I am
currently unable to successfully transpose those fields which should be of type
'date' as instead they are simple
submitted into the index as 'string' type.
Using templates, I have tried to define a dynamic_date_formats as well as
explicitly specifying a date type and format
mapping for a matched field in a dynamic template which matches against the
name of those fields which should be 'date'
types.
In either case, data fields indexed into my Elasticsearch cluster which should
be recognized as 'date' types are only
set as strings .
Here is an example template similar to that with which I have been
experimenting.
{
"template" : "index-name-*",
"mappings" : {
"_default_" : {
"dynamic_date_formats" : ["yyyy-MM-dd hh:mm"]
"dynamic_templates" : [
{ "date_field_template": {
"match": "date_*",
"mapping": {
"type": "date",
"format" : ""yyyy-MM-dd hh:mm""
}
}
}
}
Any help on this issue would be greatly appreciated.
Thanks
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
[email protected]
<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/10ff4422-ccdb-4fc0-8ccb-34b4b5e5180a%40googlegroups.com
<https://groups.google.com/d/msgid/elasticsearch/10ff4422-ccdb-4fc0-8ccb-34b4b5e5180a%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
Costin
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/53BF0B05.6060205%40gmail.com.
For more options, visit https://groups.google.com/d/optout.