The UpdateIndexCommand class is used for updating settings of indexes on ElasticSearch server.
Command ← IndexCommand ← CreateIndexCommand ← UpdateIndexCommand
PUT /<index>/_settings
- constructor(index, settings, params) - Initializes new instance of command.
- execute(client) - Executes this command.
Methods inherited from CreateIndexCommand
- getSettings() - Returns settings of index.
- setSettings(settings) - Sets settings of index.
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 settings = {
"index": {
"number_of_replicas" : 1
}
};
var cmd = new elastic.UpdateIndexCommand("test", settings);
cmd.execute(client).then(function (result) {
console.log(JSON.stringify(result, null, " "));
});
{
"acknowledged": true
}
constructor([index: string, [settings: object, [params: object]]])
execute(client: Client): Promise