Multiline queries using multi search API?

I get this error:

{
  "type": "json_parse_exception",
  "reason": "Unexpected end-of-input: expected close marker for OBJECT (from [Source: [B@3caedf13; line: 1, column: 0])\n at [Source: [B@3caedf13; line: 1, column: 3]"
}

whenever I use the multisearch API with queries that span multiple lines. Is there a way to utilize the multisearch API with queries that span multiple lines? I could consolidate the query into one line, but that would make it unreadable and unmaintainable.

Thanks!

You can assign a multiline query to a variable, then pass that variable to multisearch

From what programming language are you integrating with elasticsearch?
Maybe pick one client library that fits you well: https://www.elastic.co/guide/en/elasticsearch/client/index.html

Then you shouldn't have to worry about the fact that the msearch api (bulk and others apis too) rely on a newline to split the request.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.