There is most likely a bug around the IndexManager API, so please open a JIRA for this (the indexes are being persisted but they are not recognized and disabled at startup). Until the bug is fixed, you should be able to define the indexes statically in the JSON file and they should work as expected between restarts.
As far as the ES warning you'll have to investigate locally what the network issue (IOException) is.
I've opened MODE-2644 for this bug.
I've another question regarding use of static index definition.
We are creating namespaces and nodetype at runtime, and the use of initial content feature is not suitable for us.
If we define statically those index, the repository doesn't start stating that one of our custom namespace is not defined (which is correct!).
There's an alternative way for doing this?
Otherwise we cannot use the indexing feature at all, meanwhile the issue is fixed.
Also, perhaps, trying to use your suggestion I've probably found another issue....
Only using Elasticsearch index provider, upon each engine restart all the indexes in Elasticsearch are removed and recreated, even if statically defined in JSON and even if they already exists.
I think that this can be related to MODE-2644, because browsing IndexManager code, it seems that the existence of index is not correctly detected by the notify method at line 969-970.
Should I open another issue for that?
If you're dynamically registering your types, then no, you won't be able to make proper use of indexes until MODE-2644 is fixed.
Regarding ES, I don't understand what part of the code you're referring to exactly, but you should keep in mind that if there's an ES provider bug which doesn't manifest for all the other providers, then the bug can only be in the ES provider codebase (which is a separate artifact). The indexing SPI found in modeshape-core is shared by all index providers, so bugs there should show up the same for all the providers.
you are right, the problem arise in the elasticsearch-index-provider.
In fact, differently from the Lucene provider, when the system starts and the core indexManager tells to the provider to create indexes, the ES provider always drop the index if it exist, then creates it.
This could be right if the repository is new, but if the repository is not new, the index shouldn't be recreated, otherwise once the MODE-2644 is fixed, there will be a full reindexing every restart of the engine.
If you think it's right, I will create a new issue for this (to me) incorrect behaviour of the ES index provider.
Not sure why the ES index provider is deleting indexes each time it starts up, so yes, please open a JIRA; thanks