argyle
argyle

Reputation: 1339

elasticsearch date type mapping conflict

I have an index with a field I am storing date information in. The field is in conflict at the moment. As far as I can tell there are three kinds of values:

I want to fix the conflict.

I've tried doing a wildcard search and I get the following error:

failed to parse date field [*] with format [strict_date_optional_time||epoch_millis]

I have two questions, ultimately.

1) Is the core problem causing the conflict that when I tried to represent the timestamp in epoch_millis that I used a string rather than a number? IOW, "timestamp": 1551206688760 would have been good?

2) What is the proper way to fix this without simply tossing all the data out?

Upvotes: 0

Views: 3083

Answers (1)

Vova Bilyachat
Vova Bilyachat

Reputation: 19484

Unfortunately you will need to reindex.

  1. Create new index with date mapping to provide multiple formats

"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"

  1. Reindex your data
  2. Use aliases

Upvotes: 2

Related Questions