Skip to content

Elasticsearch::Persistence find_in_batches causes BadRequest reason unrecognized token #693

Closed
@phlegx

Description

@phlegx

Hi!
I use:

  • Elastisearch 5.x
  • elasticsearch-rails 0.1.9
  • elasticsearch-persistence 0.1.9
  • elasticsearch-ruby 5.0.3

and if I want to find_in_batches I get this error:

Elasticsearch::Transport::Transport::Errors::BadRequest: [400] {"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 'DnF1ZX...': was expecting
('true', 'false' or 'null')\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput
@2e5b1e0d; line: 1, column: 257]"}},"status":400}

The problem comes from this line in persistence/model/find.rb#L135

response = gateway.client.scroll( { scroll_id: response['_scroll_id'], scroll: scroll } )

Any idea what can be the problem?

[SOLUTION] Bug is solved in master repository of elasticsearch-ruby but not in version 5.0.3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions