elasticsearch/elasticsearch — Issue #1736: msearch should accept a leading \n
Author: clintongormley
Created: 2012-02-24 11:59:38+00:00
State: open

This query, with a `\n` at the start of the request body, throws an error:

curl -XGET 'http://127.0.0.1:9200/_all/_msearch?pretty=1' -d '
{"index":"bar"}
{}
'
{
"responses" : [ {
"error" : "SearchPhaseExecutionException[Failed to execute phase [query], total failure; shardFailures {[M13f_44ASzCtykP8D-y-Og][geonames_temp][0]: SearchParseException[[geonames_temp][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"index\":\"bar\"}]]]; nested: SearchParseException[[geonames_temp][0]: from[-1],size[-1]: Parse Failure [No parser for element [index]]]; }{[M13f_44ASzCtykP8D-y-Og][iannounce_object_1329422272][3]: SearchParseException[[iannounce_object_1329422272][3]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"index\":\"bar\"}]]]; nested: SearchParseException[[iannounce_object_1329422272][3]: from[-1],size[-1]: Parse Failure [No parser for element [index]]]; }{[M13f_44ASzCtykP8D-y-Og][foo][4]: SearchParseException[[foo][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"index\":\"bar\"}]]]; nested: SearchParseException[[foo][4]: from[-1],size[-1]: Parse Failure [No parser for element [index]]]; }{[M13f_44ASzCtykP8D-y-Og][geonames_1329424673][0]: SearchParseException[[geonames_1329424673][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"index\":\"bar\"}]]]; nested: SearchParseException[[geonames_1329424673][0]: from[-1],size[-1]: Parse Failure [No parser for element [index]]]; }{[M13f_44ASzCtykP8D-y-Og][foo][1]: SearchParseException[[foo][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"index\":\"bar\"}]]]; nested: SearchParseException[[foo][1]: from[-1],size[-1]: Parse Failure [No parser for element [index]]]; }{[M13f_44ASzCtykP8D-y-Og][iannounce_object_1329422272][2]: SearchParseException[[iannounce_object_1329422272][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"index\":\"bar\"}]]]; nested: SearchParseException[[iannounce_object_1329422272][2]: from[-1],size[-1]: Parse Failure [No parser for element [index]]]; }{[M13f_44ASzCtykP8D-y-Og][iannounce_object_1329422272][1]: SearchParseException[[iannounce_object_1329422272][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"index\":\"bar\"}]]]; nested: SearchParseException[[iannounce_object_1329422272][1]: from[-1],size[-1]: Parse Failure [No parser for element [index]]]; }{[M13f_44ASzCtykP8D-y-Og][foo][0]: SearchParseException[[foo][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"index\":\"bar\"}]]]; nested: SearchParseException[[foo][0]: from[-1],size[-1]: Parse Failure [No parser for element [index]]]; }]"
} ]
}

But the same format for `bulk` is accepted.