Skip to content

Commit

Permalink
Merge 90ddb6f into 7d432a3
Browse files Browse the repository at this point in the history
  • Loading branch information
mkielar committed Oct 11, 2016
2 parents 7d432a3 + 90ddb6f commit fd7bdd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/elasticsearch_csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ elasticsearch_csv.prototype = {
csvStream = csv(_.omit(this.options.csv, ['filePath']))
.on('data', (function (data) {
if (_.isPlainObject(data)) {
request.body.push({ index: { _index: this.options.es.index, _type: this.options.es.type, _id: uuid.v4() } });
request.body.push({ index: { _index: this.options.es.index, _type: this.options.es.type, _id: data('_id') || uuid.v4() } });
_.forEach(data, function (value, key) {
try {
data[key] = JSON.parse(value);
Expand Down Expand Up @@ -77,4 +77,4 @@ elasticsearch_csv.prototype = {
}
};

module.exports = elasticsearch_csv;
module.exports = elasticsearch_csv;

0 comments on commit fd7bdd2

Please sign in to comment.