summaryrefslogtreecommitdiffstats
path: root/app/elasticsearch.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/elasticsearch.go')
-rw-r--r--app/elasticsearch.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/elasticsearch.go b/app/elasticsearch.go
index ef34a6074..857ed570a 100644
--- a/app/elasticsearch.go
+++ b/app/elasticsearch.go
@@ -31,3 +31,16 @@ func TestElasticsearch(cfg *model.Config) *model.AppError {
return nil
}
+
+func PurgeElasticsearchIndexes() *model.AppError {
+ if esI := einterfaces.GetElasticsearchInterface(); esI != nil {
+ if err := esI.PurgeIndexes(); err != nil {
+ return err
+ }
+ } else {
+ err := model.NewAppError("PurgeElasticsearchIndexes", "ent.elasticsearch.test_config.license.error", nil, "", http.StatusNotImplemented)
+ return err
+ }
+
+ return nil
+}