Hi, I'm using a variant of the code for bulk indexing from the documentation for Elastic 6.x, and I'm having a few problems.
Here's a typical document:
{ index: { _index: 'messages', _type: '_doc', _id: 21653 } },
{ user_id: 11,
creation: '2016-11-07T15:43:03:000',
modification: '2019-04-28T11:40:16:000',
title:
'Dark Workflows: How 5 Signatures Became a Productivity Write-Off',
note: 'REMOVED',
links_to_asset: [ [Object] ],
number_of_words: 804,
phrases: [],
favourite: [],
message_id: 13,
from: 'Wayne Smallman <REMOVED>',
seen: 'unread',
to_read: [],
engagement: [],
in_folder_id: 587 }
... and then it gets so far in and I get the following error:
{ took: 20,
errors: true,
items:
[ { index: [Object] },
{ index: [Object] },
{ index: [Object] },
{ index: [Object] },
{ index: [Object] },
{ index: [Object] },
{ index: [Object] },
{ index: [Object] },
{ index: [Object] },
{ index: [Object] } ] }
Let's face it, as errors go, that's not in the least bit helpful, nor do I understand where the data has gotten to for each of the corresponding indexes, assuming the data should have been listed there.
You'll have noticed links_to_asset: [ [Object] ]
, and I've tried converting each of the raw objects with JSON.stringify()
versions, but that makes no difference.
Looking at the data, and after having added lots of tracer comments, it's choking on the first attempt at a bulk index, although — as explained — the data appears to be correct.
Some guidance would be much appreciated.