Reindexing drops the field datatypes

I am trying to reindex data in elasticsearch. In our case, there are a lot of indexed fields (~6000) and because all of them are indexed, ES has already determined the datatypes for quite a few of them.
In the new indices I am creating, I have defined a mapping which specifies only the fields that we would require to be indexed(~30); but we would require aggregation on other fields (which are not indexed).
So the issue I am facing is that ES drops the datatypes for the fields that are not indexed. Is there a way I can reindex with retaining the datatype mapping but indexing only the fields I want.

If you don't map the field then Elasticsearch won't build any data structures for it. Unless automatic mapping is turned on, then it'll map it for you. Anyway. I think what you are looking for is the "index": false option documented here. You'll want to make sure you get doc values for the fields you want to aggregate on so you should map them with "index": false.

Thanks for the reply.But to use the index option I would have to write a mapping which includes all the fields and specify "index" : false in the fields which I do not want to be indexed.

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