After JSON files with index and template definitions were introduced to make schema migration, we have a duplication of logic, as we still have our Java classes defining the ELS schema on place. The goal is to get rid of duplication.
- Use JSON files from ElasticsearchSchemaManager.
- remove schema definition from Java classes. Although, we can leave there the constants defining the field names.
- ElasticsearchSchemaManager#createTemplate: It may be that we don't need to create "main" indices and to adjust aliases to have write index defined. Ideally we only create templates here. And whenever in code we need to index the document, we should index them to "main" index, not to alias.
- Currently we have possibility to configure number of shards and number of replicas for part of the indices. It would be nice to preserve this behaviour. We can discuss separately, how this can be achieved