var arrayUtils = require('./utils/arrayUtils'); var EsClient = require('./utils/customElasticSearchClient');
npm install aws-sdk, npm install q
var esClient = new EsClient({ endpoint: '', region: '', profile: ''});
Please Note : if using profile based creedential loading, put your credential at '~/.aws/credential' file. refer AWS Docs. Give profile undefined, to use IAM role based credential
var params = {
index: indexName,
type: docType,
id: id,
body: body
};
esClient.index(params);
var params = {
index: indexName
};
esClient.indices.exists(params);
var params = {
index: indexName,
body: {
mappings: mappings,
settings: settings
}
};
esClient.indices.create(params)
var params = {
index: indexName,
type: docType,
body: dslQuery
};
esClient.search(params)
var params = {
index: indexName,
body: settings
};
esClient.indices.putSettings(params);
esClient.indices.close({index: index});
esClient.indices.open({index: index});
var actions = [];
actions.push({
remove: {index: "*", alias: aliasName}
});
actions.push({
add: {index: indexName, alias: aliasName}
});
esClient.indices.updateAliases({
body: {
actions: actions
}
});
var params = {
index: indexNames
};
esClient.indices.delete(params);