Reindexing automatically changed my fieldtype

In my original index I had location field with datatype of geo_point, after reindexing it, the same field in new index seems to have changed to floar
When trying to make same query in new index (reindexed from old), I get:

"reason": "failed to find geo_point field [location]",

old index:
"location": {
"type": "geo_point"
},

new index:
"location": {
"properties": {
"lat": {
"type": "float"
},
"lon": {
"type": "float"
}
}

When I try to change it (although i know it is ilegal), I get:

"type": "illegal_argument_exception",
"reason": "Can't merge a non object mapping [location] with an object mapping [location]"

Having that in mind I am thinking on what options do I have:

  1. new reindexing setting that specific field type before

  2. ES DLS script inline operation to move it the data from one field to another

  3. I wrote a script to move that data to a new field with proper datatype:
    however it would take 14 days to finish it, it's about 20M docs

Did you apply the same mapping to the new index before starting the reindex? If you don't it uses dynamic mappings.

I guess that was my error. I though that in reindexing it would automatically apply the mappings of the original index... : (

as for solution Warkolm, what do you think is the best ?

Just create the index before and make sure the original mappings are used at that time.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.