Is there a simple way to see if template exists in Java?
client.admin().indices().prepareGetTemplates(TEMPLATE_NAME).get()
Was thinking more of a prepareExistsTemplates() to do something like HEAD call
Is there a simple way to see if template exists in Java?
client.admin().indices().prepareGetTemplates(TEMPLATE_NAME).get()
Was thinking more of a prepareExistsTemplates() to do something like HEAD call
This is how I implemented it so far:
public static boolean isTemplateExist(Client client, String template) {
return !client.admin().indices().prepareGetTemplates(template).get().getIndexTemplates().isEmpty();
}
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.