The OptimizeCommand class is used for optimize indexes.
GET /<index>/_optimize
- constructor(index, params) - Initializes new instance of command.
- execute(client) - Executes this command.
Methods inherited from IndexCommand
- getIndex() - Returns name of index.
- setIndex(index) - Sets name of index.
Methods inherited from Command
- getParameter(name) - Returns value of the specified parameter.
- setParameter(name, value) - Sets value of the specified parameter.
var elastic = require("elastic");
var client = new elastic.Client({/*options*/});
var cmd = new elastic.OptimizeCommand("test");
cmd.execute(client).then(function (result) {
console.log(JSON.stringify(result, null, " "));
});{
"_shards": {
"total": 12,
"successful": 12,
"failed": 0
}
}
constructor([index: string, [params: object]])
execute(client: Client): Promise