Skip to content

Commit

Permalink
Restore
Browse files Browse the repository at this point in the history
  • Loading branch information
asumaran committed Mar 11, 2016
1 parent 38fe6b5 commit 815aa8d
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lib/elastic.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,17 @@ elastic.deleteTemplate = function () {
};

elastic.setTemplate = function () {
client.indices.putTemplate({
create: true,
name: TEMPLATE_NAME,
body: templateMapping
}, function (err) {
if (err) {
throw err;
}
gutil.log(chalk.green('Template added:', TEMPLATE_NAME));
this.deleteTemplate().then(function () {
client.indices.putTemplate({
create: true,
name: TEMPLATE_NAME,
body: templateMapping
}, function (err) {
if (err) {
throw err;
}
gutil.log(chalk.green('Template added:', TEMPLATE_NAME));
});
});
};

Expand Down

0 comments on commit 815aa8d

Please sign in to comment.