2

I have an index in elasticsearch 6.2.4, for which i created a new index in new elasticsearch cluster 7.6.1.

I have copied the mapping for this index from 6.2.4 to 7.6.1, but when i tried to _reindex from 6.2.4 to 7.6.1.

I get the below error.

  "failures" : [
{
  "index" : "newindex",
  "type" : "_doc",
  "id" : "someid",
  "cause" : {
    "type" : "mapper_parsing_exception",
    "reason" : "failed to parse field [UPDATES.when] of type [date] in document with id 'someid'. Preview of field's value: '1.528501444E9'",
    "caused_by" : {
      "type" : "illegal_argument_exception",
      "reason" : "failed to parse date field [1.528501444E9] with format [epoch_second]",
      "caused_by" : {
        "type" : "date_time_parse_exception",
        "reason" : "Failed to parse with all enclosed parsers"
      }
    }
  },
  "status" : 400
}

_reindex call done at 7.6.1's kibana

POST _reindex/?pretty
{
  "source": {
    "remote": {
      "host": "http://oldserver:9200"

    },
    "index": "oldindex",
    "query": {
      "match_all": {}
    }
  },
  "dest": {
    "index": "newindex"
  }
}

Mapping of updates field is same in both places

"UPDATES" : {
          "properties" : {
            "key" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "when" : {
              "type" : "date",
              "format" : "epoch_second"
            }

What am I missing here ?

1
  • in the original index it is stored as in the format as "when": 1523274629 (ignore the number, check the format) Commented Apr 8, 2020 at 7:12

1 Answer 1

2

I guess the timestamp which is appearing in one of your date feild 1.528501444E9 is UNIX timestamp in scientific notation.

But Elasticsearch fails because it can't parse 1.528501444E9 since I suppose as per you exception the format that you have given for this field is epoch_second which does not take this format.

You can read futher related to this format from here https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html

Sign up to request clarification or add additional context in comments.

7 Comments

but i was able to make mapping in the 7.6.1 in epoch_second, only when i am _reindexing it fails. in the original index it is stored as in the format as "when": 1523274629 (ignore the number, check the format)
you can see in the link given by you that epoch_second is supported
yes epoch_second is supported but issue is when you pass this value 1.528501444E9 it throws error but when you pass this kind of value 1523274629 it works fine
The value being passed is by _reindex & the actual value stored is in this format "when": 1523274629
Have you created mapping of this newindex similar to old index before running reindex API
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.