I really can't understand why when I run a bulk insert I lost the previous data in the same collection without executing any delete operation? this is weird.
any idea?
var client = new elasticsearch.Client( {
hosts: [
'http://localhost:9200/'
]
})
. . .
InserTweets: function (arrayobj, callback) {
var items=[];
var count=1;
arrayobj.forEach(element => {
items.push({ index: { _index: 'twitter', _type: 'tweet', _id: count }},element);
count++;
});
client.bulk({body:items}, function (err, resp, status) {
callback(err, resp, status);
}, function (err, resp, status) {
console.log(err);
});
}