Реализация:
es.indices.exists({index: 'teste'}, (err, res, status) => {
if (res) {
console.log('index already exists');
} else {
es.indices.create( {index: 'teste'}, (err, res, status) => {
console.log(err, res, status);
})
}
});
И это ошибка, которую я получаю по моему запросу.
Erro: status: 400,
api_1 | displayName: 'BadRequest',
api_1 | message: '[remote_transport_exception] [Do300lB][10.244.0.93:9300][indices:admin/create]',
api_1 | path: '/rerun',
api_1 | query: {},
api_1 | body: undefined,
api_1 | statusCode: 400,
api_1 | response: '{"error":{"root_cause":[{"type":"remote_transport_exception","reason":"[Do300lB][10.244.0.93:9300][indices:admin/create]"}],"type":"illegal_argument_exception","reason":"Failed to parse value [5] for setting [index.number_of_shards] must be <= 3"},"status":400}',
api_1 | toString: [Function],
api_1 | toJSON: [Function] } { error:
api_1 | { root_cause: [ [Object] ],
api_1 | type: 'illegal_argument_exception',
api_1 | reason: 'Failed to parse value [5] for setting [index.number_of_shards] must be <= 3' },
api_1 | status: 400 } 400.
Кто-нибудь знает, что именно это значит? Я пытался гуглить, но я не нашел никакого возможного решения.