jbmyid
jbmyid

Reputation: 2015

SearchKick(Elastic Search) freshly reindex specific record

Hi I have one issue for reindexing record which was reindexed earlier with attribute having different datatype.

eg: User 1 having date_of_birth as string while reindex and now i want to reindex that user with datetime column its crashing with error

"MapperParsingException[failed to parse [dob]]; nested: NumberFormatException"

Tried deleting the index for the record with following and reindex but did not worked.

User.searchkick_index.remove(user)

Upvotes: 1

Views: 1858

Answers (1)

Val
Val

Reputation: 217314

You cannot change the type of an existing field, once it's created there are only a few changes that are allowed. The most surefire way is to wipe your index and recreate it from scratch with the proper mapping.

A temporary alternate solution is to rename your field so a new one with the new date type will be created.

Upvotes: 1

Related Questions