I am developping a small library that integrates Morphia (MongoDB) and
ElasticSearch using the ES java API.
During application startup I use Annotated Entities to generate the ES
Everything works pretty fine and I am able to create the index, then
analyzers and the type mappings properly . Indexing works great too.
However I have noted that when restarting the application and going
through the index mapping generation process again (using putMapping
API) the content of the index gets deleted.
I do perform a check to see if the index already exists to avoid
recreating it, however, in my Library the mappings are automatically
uploaded each time the app starts which maybe is the problem ...
Is it a normal behavior of ES? Is the content wiped away when type
mappings are redefined, even if they are exactly the same as the
Is there a way to get existing mappings and compare them to the ones
I'm about to upload to avoid this problem?
Hope I'm clear enough
Thanks for your help