Changing the mapping of fields

I am using dynamic mapping for my indexes, since I'm not sure about the data format. If i want to change the datatype for field, then what are my options ? Mapping api doesn't support changing the data type.

Lets say I created a field called date with data type as "long", if i need to change the data type to string or even maybe an object. How can this be done ?


You need to reindex the data, you cannot change a field once it has been set.

When you say reindexing, you mean moving all the data from my current index to new index. Is that right?
This will cause the application to be down for quite sometime. Is that the only option ?


Why? Check out Changing Mapping with Zero Downtime | Elastic Blog

Thanks for the quick reply. Changes suggested in this above are valid for version 2.3 as well, right ?


Why? Check out

What I don't understand about this is:
If I have a field - currently metadata.url.path (as inserted into a status index by stormcrawler), and I re-index to be metadata.url%2Epath (to work with updated stormcrawler), stormcrawler is still looking for the field: metadata.url.path.

Even if I alias the status index and the new index and have stormcrawler look at the alias, the inconsistency of the fieldnames will mean that some records will work and some won't, am I right?

Or is there some way of telling the alias that, when querying, it should "rename" metadata.url.path to metadata.url%2Epath?

Ahh, well then yes, you need to switch your underlying application code.
There's no good way around that sorry.