From 1d1da548bd35ee1c21a4e1658f465c35c58cebb5 Mon Sep 17 00:00:00 2001 From: schneefux Date: Fri, 25 Aug 2017 23:08:25 +0200 Subject: fix access to series name --- worker.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'worker.js') diff --git a/worker.js b/worker.js index 436fc52..2b3816f 100644 --- a/worker.js +++ b/worker.js @@ -190,11 +190,16 @@ amqp.connect(RABBITMQ_URI).then(async (rabbit) => { } ) ); db_profiler.done("database transaction"); + if (data.length == 0) { + logger.error("no data!"); + return; + } + const es_profiler = logger.startTimer(); await elastic.bulk({ body: [].concat(... data.map((d) => [ { index: { - _index: `${INDEX}_${d.participant.series.name}`, + _index: `${INDEX}_${d["participant.series.name"]}`, _type: INDEX, _id: `${d.participant_api_id}@${d.start}+${d.end}` } }, -- cgit v1.3.1