I am looking for a way to generate Index mapping definition from entities.
I have to run the same application in two environments with different versions of Elastic search (2.1.x and 5.x).
What came to my mind is to have all information for mapping in Entities (by annotation) and when the application running in 2.1.x env generate Index for that environment and when it is running in 5.x env generate Index for that.
Is there any way to address this issue. If I create two different mapping files I would have to apply any changes in both files which I don't like.