What is an efficient way to ensure my indexed documents are only using my custom templates/mappings (in ES 2.3.x)


#1

Hi! Here's my situation - I have a service that indexes documents into ES using the bulk API. In ES 1.5.x, I used to have custom templates that were loaded from disk when the ES node was started. In ES 2.3.x, all template management is API-based, so I changed my indexing service so that, on startup, the custom template was loaded via the ES API, and then the service could begin indexing documents. My indexing service depends on the setting action.auto_create_index: true so that it can avoid one or more API calls to check if the index exists before indexing documents into it (i.e. we're trying to index efficiently).

My issue that I'm concerned with, is that, while my service is already up, somehow the custom template is deleted. We need to expose ES API access, and since there is a "delete template" API call available, this is a real possibility. If this happens, and my indexing service indexes a document into a new index, that new index will be created without my custom mappings.

I attempted to change the setting index.mapper.dynamic to false, but due to this (now closed) issue, I cannot take this approach.

I'm looking for alternate, efficient solutions that will ensure that it is not possible to accidentally index documents with incorrect mappings. Upgrading to ES 5.x is not an option at this time. We've considered turning off index-auto-creation, but I'd prefer not to head down this path.

Thanks!


(system) #2