I've tried putting newlines everywhere (first at the logic places, then I slowly became paranoid about everything and re-evaluated my existence)
But I still end up with this error
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"The msearch request must be terminated by a newline [\n]"}],"type":"illegal_argument_exception","reason":"The msearch request must be terminated by a newline [\n]"},"status":400}
it is impossible to take a look at the request you actually sent to elasticsearch, so this is super hard to debug. The error message says, that the last character of your msearch body should be a new line. Is this the case?
Same reasons the Post Office expect you to put letters in envelopes - they're quicker to sort and distribute if the distributor only deals with the routing information and they don't have to parse the details of the letter contents.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.