ElasticSearch mapping date RFC 2822


(Federico García) #1

Hi!

Original date RFC 2822: "Wed, 27 Mar 2013 15:12:14 +0000"

Mapping: "created_at": {

                                "type": "date",

                                "format": "EEEE, dd MMM yyyy HH:mm:ss Z"

}

Elasticsearch index date as format string instead of date Elasticsearch
produces an exception.

Caused by: org.elasticsearch.index.mapper.MapperParsingException: failed to
parse date field [Thu, 17 Oct 2013 16:09:44 +0000], tried both date format
[EEEE, dd MMM yyyy HH:mm:ss Z], and timestamp number with locale [null]

    at 

org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:465)

    at 

org.elasticsearch.index.mapper.core.DateFieldMapper.innerParseCreateField(DateFieldMapper.java:413)

    at 

org.elasticsearch.index.mapper.core.NumberFieldMapper.parseCreateField(NumberFieldMapper.java:167)

    at 

org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:385)

    ... 16 more

Caused by: java.lang.IllegalArgumentException: Invalid format: "Thu, 17 Oct
2013 16:09:44 +0000"

    at 

org.elasticsearch.common.joda.time.format.DateTimeFormatter.parseMillis(DateTimeFormatter.java:752)

    at 

org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:459)

    ... 19 more

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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(David Pilato) #2

Try with EEE instead EEEE.

HTH

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 17 oct. 2013 à 19:12, Federico García federico@federicogarcia.es a écrit :

Hi!
Original date RFC 2822: "Wed, 27 Mar 2013 15:12:14 +0000"
Mapping: "created_at": {
"type": "date",
"format": "EEEE, dd MMM yyyy HH:mm:ss Z"
}

Elasticsearch index date as format string instead of date Elasticsearch produces an exception.

Caused by: org.elasticsearch.index.mapper.MapperParsingException: failed to parse date field [Thu, 17 Oct 2013 16:09:44 +0000], tried both date format [EEEE, dd MMM yyyy HH:mm:ss Z], and timestamp number with locale [null]
at org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:465)
at org.elasticsearch.index.mapper.core.DateFieldMapper.innerParseCreateField(DateFieldMapper.java:413)
at org.elasticsearch.index.mapper.core.NumberFieldMapper.parseCreateField(NumberFieldMapper.java:167)
at org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:385)
... 16 more
Caused by: java.lang.IllegalArgumentException: Invalid format: "Thu, 17 Oct 2013 16:09:44 +0000"
at org.elasticsearch.common.joda.time.format.DateTimeFormatter.parseMillis(DateTimeFormatter.java:752)
at org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:459)
... 19 more

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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Federico García-2) #3

Hi David:

Thanks for your quick response.

I've tried with EEE, fails with the following error.

org.elasticsearch.index.mapper.MapperParsingException: failed to parse
[interaction.interaction.created_at]
at
org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:396)
at
org.elasticsearch.index.mapper.object.ObjectMapper.serializeValue(ObjectMapper.java:599)
at
org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:467)
at
org.elasticsearch.index.mapper.object.ObjectMapper.serializeObject(ObjectMapper.java:515)
at
org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:457)
at
org.elasticsearch.index.mapper.object.ObjectMapper.serializeObject(ObjectMapper.java:515)
at
org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:457)
at
org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:507)
at
org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:451)
at
org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:329)
at
org.elasticsearch.action.bulk.TransportShardBulkAction.shardIndexOperation(TransportShardBulkAction.java:396)
at
org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnPrimary(TransportShardBulkAction.java:155)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:521)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:419)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.elasticsearch.index.mapper.MapperParsingException: failed to
parse date field [Thu, 17 Oct 2013 17:28:08 +0000], tried both date format
[EEE, dd MMM yyyy HH:mm:ss Z], and timestamp number with locale [null]
at
org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:465)
at
org.elasticsearch.index.mapper.core.DateFieldMapper.innerParseCreateField(DateFieldMapper.java:413)
at
org.elasticsearch.index.mapper.core.NumberFieldMapper.parseCreateField(NumberFieldMapper.java:167)
at
org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:385)
... 16 more
Caused by: java.lang.IllegalArgumentException: Invalid format: "Thu, 17 Oct
2013 17:28:08 +0000"
at
org.elasticsearch.common.joda.time.format.DateTimeFormatter.parseMillis(DateTimeFormatter.java:752)
at
org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:459)
... 19 more

Thanks.
Federico.

El jueves, 17 de octubre de 2013 19:12:37 UTC+2, Federico García escribió:

Hi!

Original date RFC 2822: "Wed, 27 Mar 2013 15:12:14 +0000"

Mapping: "created_at": {

                                "type": "date",

                                "format": "EEEE, dd MMM yyyy HH:mm:ss 

Z"

}

Elasticsearch index date as format string instead of date Elasticsearch
produces an exception.

Caused by: org.elasticsearch.index.mapper.MapperParsingException: failed
to parse date field [Thu, 17 Oct 2013 16:09:44 +0000], tried both date
format [EEEE, dd MMM yyyy HH:mm:ss Z], and timestamp number with locale
[null]

    at 

org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:465)

    at 

org.elasticsearch.index.mapper.core.DateFieldMapper.innerParseCreateField(DateFieldMapper.java:413)

    at 

org.elasticsearch.index.mapper.core.NumberFieldMapper.parseCreateField(NumberFieldMapper.java:167)

    at 

org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:385)

    ... 16 more

Caused by: java.lang.IllegalArgumentException: Invalid format: "Thu, 17
Oct 2013 16:09:44 +0000"

    at 

org.elasticsearch.common.joda.time.format.DateTimeFormatter.parseMillis(DateTimeFormatter.java:752)

    at 

org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:459)

    ... 19 more

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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(David Pilato) #4

Wondering now about Z.

Could you try with a date having GMT instead of +0000 ?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 17 oct. 2013 à 19:45, Federico García fgredruello@icloud.com a écrit :

Hi David:

Thanks for your quick response.

I've tried with EEE, fails with the following error.

org.elasticsearch.index.mapper.MapperParsingException: failed to parse [interaction.interaction.created_at]
at org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:396)
at org.elasticsearch.index.mapper.object.ObjectMapper.serializeValue(ObjectMapper.java:599)
at org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:467)
at org.elasticsearch.index.mapper.object.ObjectMapper.serializeObject(ObjectMapper.java:515)
at org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:457)
at org.elasticsearch.index.mapper.object.ObjectMapper.serializeObject(ObjectMapper.java:515)
at org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:457)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:507)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:451)
at org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:329)
at org.elasticsearch.action.bulk.TransportShardBulkAction.shardIndexOperation(TransportShardBulkAction.java:396)
at org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnPrimary(TransportShardBulkAction.java:155)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:521)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:419)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.elasticsearch.index.mapper.MapperParsingException: failed to parse date field [Thu, 17 Oct 2013 17:28:08 +0000], tried both date format [EEE, dd MMM yyyy HH:mm:ss Z], and timestamp number with locale [null]
at org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:465)
at org.elasticsearch.index.mapper.core.DateFieldMapper.innerParseCreateField(DateFieldMapper.java:413)
at org.elasticsearch.index.mapper.core.NumberFieldMapper.parseCreateField(NumberFieldMapper.java:167)
at org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:385)
... 16 more
Caused by: java.lang.IllegalArgumentException: Invalid format: "Thu, 17 Oct 2013 17:28:08 +0000"
at org.elasticsearch.common.joda.time.format.DateTimeFormatter.parseMillis(DateTimeFormatter.java:752)
at org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:459)
... 19 more

Thanks.
Federico.

El jueves, 17 de octubre de 2013 19:12:37 UTC+2, Federico García escribió:

Hi!
Original date RFC 2822: "Wed, 27 Mar 2013 15:12:14 +0000"
Mapping: "created_at": {
"type": "date",
"format": "EEEE, dd MMM yyyy HH:mm:ss Z"
}

Elasticsearch index date as format string instead of date Elasticsearch produces an exception.

Caused by: org.elasticsearch.index.mapper.MapperParsingException: failed to parse date field [Thu, 17 Oct 2013 16:09:44 +0000], tried both date format [EEEE, dd MMM yyyy HH:mm:ss Z], and timestamp number with locale [null]
at org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:465)
at org.elasticsearch.index.mapper.core.DateFieldMapper.innerParseCreateField(DateFieldMapper.java:413)
at org.elasticsearch.index.mapper.core.NumberFieldMapper.parseCreateField(NumberFieldMapper.java:167)
at org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:385)
... 16 more
Caused by: java.lang.IllegalArgumentException: Invalid format: "Thu, 17 Oct 2013 16:09:44 +0000"
at org.elasticsearch.common.joda.time.format.DateTimeFormatter.parseMillis(DateTimeFormatter.java:752)
at org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:459)
... 19 more

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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Federico García-2) #5

SOLVED.

"type" : "date",
"format" : "E, d MMM yyyy HH:mm:ss Z",
"locale" : "US"

El jueves, 17 de octubre de 2013 19:12:37 UTC+2, Federico García escribió:

Hi!

Original date RFC 2822: "Wed, 27 Mar 2013 15:12:14 +0000"

Mapping: "created_at": {

                                "type": "date",

                                "format": "EEEE, dd MMM yyyy HH:mm:ss 

Z"

}

Elasticsearch index date as format string instead of date Elasticsearch
produces an exception.

Caused by: org.elasticsearch.index.mapper.MapperParsingException: failed
to parse date field [Thu, 17 Oct 2013 16:09:44 +0000], tried both date
format [EEEE, dd MMM yyyy HH:mm:ss Z], and timestamp number with locale
[null]

    at 

org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:465)

    at 

org.elasticsearch.index.mapper.core.DateFieldMapper.innerParseCreateField(DateFieldMapper.java:413)

    at 

org.elasticsearch.index.mapper.core.NumberFieldMapper.parseCreateField(NumberFieldMapper.java:167)

    at 

org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:385)

    ... 16 more

Caused by: java.lang.IllegalArgumentException: Invalid format: "Thu, 17
Oct 2013 16:09:44 +0000"

    at 

org.elasticsearch.common.joda.time.format.DateTimeFormatter.parseMillis(DateTimeFormatter.java:752)

    at 

org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:459)

    ... 19 more

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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Federico García-2) #6

Thanks David.

Solved, add "locale" parameter to mapping.

"type" : "date",
"format" : "E, d MMM yyyy HH:mm:ss Z",
"locale" : "US"

El jueves, 17 de octubre de 2013 20:06:00 UTC+2, David Pilato escribió:

Wondering now about Z.

Could you try with a date having GMT instead of +0000 ?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 17 oct. 2013 à 19:45, Federico García <fgred...@icloud.com<javascript:>>
a écrit :

Hi David:

Thanks for your quick response.

I've tried with EEE, fails with the following error.

org.elasticsearch.index.mapper.MapperParsingException: failed to parse
[interaction.interaction.created_at]
at
org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:396)
at
org.elasticsearch.index.mapper.object.ObjectMapper.serializeValue(ObjectMapper.java:599)
at
org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:467)
at
org.elasticsearch.index.mapper.object.ObjectMapper.serializeObject(ObjectMapper.java:515)
at
org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:457)
at
org.elasticsearch.index.mapper.object.ObjectMapper.serializeObject(ObjectMapper.java:515)
at
org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:457)
at
org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:507)
at
org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:451)
at
org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:329)
at
org.elasticsearch.action.bulk.TransportShardBulkAction.shardIndexOperation(TransportShardBulkAction.java:396)
at
org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnPrimary(TransportShardBulkAction.java:155)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:521)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:419)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.elasticsearch.index.mapper.MapperParsingException: failed
to parse date field [Thu, 17 Oct 2013 17:28:08 +0000], tried both date
format [EEE, dd MMM yyyy HH:mm:ss Z], and timestamp number with locale
[null]
at
org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:465)
at
org.elasticsearch.index.mapper.core.DateFieldMapper.innerParseCreateField(DateFieldMapper.java:413)
at
org.elasticsearch.index.mapper.core.NumberFieldMapper.parseCreateField(NumberFieldMapper.java:167)
at
org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:385)
... 16 more
Caused by: java.lang.IllegalArgumentException: Invalid format: "Thu, 17
Oct 2013 17:28:08 +0000"
at
org.elasticsearch.common.joda.time.format.DateTimeFormatter.parseMillis(DateTimeFormatter.java:752)
at
org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:459)
... 19 more

Thanks.
Federico.

El jueves, 17 de octubre de 2013 19:12:37 UTC+2, Federico García escribió:

Hi!

Original date RFC 2822: "Wed, 27 Mar 2013 15:12:14 +0000"

Mapping: "created_at": {

                                "type": "date",

                                "format": "EEEE, dd MMM yyyy HH:mm:ss 

Z"

}

Elasticsearch index date as format string instead of date Elasticsearch
produces an exception.

Caused by: org.elasticsearch.index.mapper.MapperParsingException: failed
to parse date field [Thu, 17 Oct 2013 16:09:44 +0000], tried both date
format [EEEE, dd MMM yyyy HH:mm:ss Z], and timestamp number with locale
[null]

    at 

org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:465)

    at 

org.elasticsearch.index.mapper.core.DateFieldMapper.innerParseCreateField(DateFieldMapper.java:413)

    at 

org.elasticsearch.index.mapper.core.NumberFieldMapper.parseCreateField(NumberFieldMapper.java:167)

    at 

org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:385)

    ... 16 more

Caused by: java.lang.IllegalArgumentException: Invalid format: "Thu, 17
Oct 2013 16:09:44 +0000"

    at 

org.elasticsearch.common.joda.time.format.DateTimeFormatter.parseMillis(DateTimeFormatter.java:752)

    at 

org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(DateFieldMapper.java:459)

    ... 19 more

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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #7