Timestamp error ElasticSearch 2.0.0


(Kike) #1

Hello,

I'm having problems with my mapping timestamp. My mapping is:

{
 "_source" : {
          "excludes" : ["file"]
       },
      "_timestamp": {
         "enabled": true,
         "format": "dd-MM-yyyy HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss.SSSZZ"
      },
      "dynamic": "strict",
        "properties": {
        "file": {
            "type": "attachment",
            "fields" : {
                    "content" : {"analyzer" : "analyzer"},
                    "title" : {"store" : "yes"},
                    "date" : {"store" : "yes"},
                    "author" : {"analyzer" : "analyzer"},
                    "keywords" : {"store" : "yes"},
                    "content_type" : {"store" : "yes"},
                    "content_length" : {"store" : "yes"},
                    "language" : {"store" : "yes"}
                }
        },
        "field1": {
            "type": "integer",
            "doc_values": true,
            "index" : "not_analyzed",
            "include_in_all": false
            
         },
         "field2": {
            "type": "integer",
            "doc_values": true,
            "index" : "not_analyzed",
            "include_in_all": false
         },
         "field3": {
            "type": "integer",
            "doc_values": true,
            "index" : "not_analyzed",
            "include_in_all": false
         }
}
}

But to perform the action of "indexRequestBuilder.execute () actionGet ()." I returned the following error:

org.elasticsearch.action.TimestampParsingException: failed to parse timestamp [1447926177415]
atorg.elasticsearch.cluster.metadata.MappingMetaData$Timestamp.parseStringTimestamp(MappingMetaData.java:180) ~ [elasticsearch-2.0.0.jar: 2.0.0]
at org.elasticsearch.action.index.IndexRequest.process (IndexRequest.java:567) ~ [elasticsearch-2.0.0.jar: 2.0.0]
at org.elasticsearch.action.index.TransportIndexAction.resolveRequest (TransportIndexAction.java:131) ~ [elasticsearch-2.0.0.jar: 2.0.0]

I do not understand this because I have another mapping defined timestamp and gives me the same error and the data is indexed correctly.

Can anybody help me, please? Thank you!

a greeting.


(Adrien Grand) #2

Can you show how you build your indexRequestBuilder?

Does it fix the problem to append ||epoch_millis at the end of the format that is configured on your _timestamp field?


(Kike) #3

It is perfect, very nice , thank you very much


(system) #4