{ [Error: [illegal_argument_exception] Failed to parse request body]
status: 400,
displayName: 'BadRequest',
message: '[illegal_argument_exception] Failed to parse request body',
path: '/_search/scroll',
query: { scroll: '1m' },
body: 'DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAAE5FkZMaEh3cjBDUi1HRlhLSE1LdWstZEEAAAAAAAABOhZGTGhId3IwQ1ItR0ZYS0hNS3VrLWRBAAAAAAAAATsWRkxoSHdyMENSLUdGWEtITUt1ay1kQQAAAAAAAAE8FkZMaEh3cjBDUi1HRlhLSE1LdWstZEEAAAAAAAABPRZGTGhId3IwQ1ItR0ZYS0hNS3VrLWRB',
statusCode: 400,
response: '{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Failed to parse request body"}],"type":"illegal_argument_exception","reason":"Failed to parse request body","caused_by":{"type":"json_parse_exception","reason":"Unrecognized token 'DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAAE5FkZMaEh3cjBDUi1HRlhLSE1LdWstZEEAAAAAAAABOhZGTGhId3IwQ1ItR0ZYS0hNS3VrLWRBAAAAAAAAATsWRkxoSHdyMENSLUdGWEtITUt1ay1kQQAAAAAAAAE8FkZMaEh3cjBDUi1HRlhLSE1LdWstZEEAAAAAAAABPRZGTGhId3IwQ1ItR0ZYS0hNS3VrLWRB': was expecting ('true', 'false' or 'null')\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@3e41afb8; line: 1, column: 457]"}},"status":400}',
toString: [Function],
toJSON: [Function] }
I have implement scroll api in 5.2.2 elasticsearch. It works fine for 5.2.2 and other lower version. But It gives an above error in 5.3. Is there anything i have to change in 5.3?
Here is my sample code.
var data = [];
client.search({
index: source.index,
scroll: '1m',
body: bodyobj
}, function getMoreUntilDone(err, res) {
var cellValues = [];
if (!err) {
res.hits.hits.forEach(function(hit) {
data.push(hit);
});
if (data.length<res.hits.total && data.length < sampleSize) {
// now we can call scroll over and over
client.scroll({
scrollId: res._scroll_id,
scroll: '1m'
}, getMoreUntilDone);
return;
}