我正在使用文件上传功能,并以json格式重写excel文件。我需要将此json文件存储到弹性搜索中。我可以将该excel数据存储到elasticsearch中。
任何人都可以帮助我吗?
提前致谢。
var elasticsearch = require('elasticsearch');
var client = new elasticsearch.Client({
host: 'localhost:9200',
log: 'trace'
});
client.create({
index: 'myindex',
type: 'mytype',
id:2,
body: workbook.Strings,
},function (error) {
if (error)
{
console.log('elasticsearch cluster is down!');
}
else
{
console.log('All is well');
}
});
但我收到elasticsearch cluster is down!
Elasticsearch TRACE: 2015-09-01T12:14:59Z
错误。请帮我解决此问题。