My code written in nodejs
import elasticsearch from 'elasticsearch';
const elasticClient = new elasticsearch.Client({
host: es_host
})
let body =
let _query =
{
"size": 1,
"query": {
"match": {"item_id" : 1}
}
};
body.push({index: "myindex"})
body.push(_query)
let result = await elasticClient.msearch({ body: body })
Getting Error From Elasticsearch Api
'{"error":{"root_cause":[{"type":"parsing_exception","reason":"Unknown key for a VALUE_STRING in [index].","line":1,"col":10}],"type":"parsing_exception","reason":"Unknown key for a VALUE_STRING in [index].","line":1,"col":10},"status":400}',