Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable automatic index creation in spring boot / spring data elasticsearch

I'd like to separate the process of creating the index (including settings and mapping) from the rest of the application to have more control over the behaviour of my application. My spring boot project creates the index automatically on startup. Is there a way to disable the automatic index creation process?

like image 792
Benjamin Avatar asked Jul 13 '17 07:07

Benjamin


1 Answers

@Document annotation has createIndex property which is by default set to true. Just set it to:

@Document(indexName = "products", createIndex = false)
like image 180
Joanna Avatar answered Nov 19 '22 09:11

Joanna