Home > Back-end >  Elasticsearch multi search api is not working properly
Elasticsearch multi search api is not working properly

Time:07-25

Im using elasticsearch 8.3.2. Im facing the below issue while using multi search api.

API: https://elasticrunningserver:9200/myindex/_msearch

Payload:

 { }
{"query" : {"match" : { "message": "this is a test"}}}
{"query" : {"match_all" : {}}}

Response:

{
    "error": {
        "root_cause": [
            {
                "type": "illegal_argument_exception",
                "reason": "key [query] is not supported in the metadata section"
            }
        ],
        "type": "illegal_argument_exception",
        "reason": "key [query] is not supported in the metadata section"
    },
    "status": 400
}

Please help me to resolve this.

CodePudding user response:

You need a metadata section for each query

{ }
{"query" : {"match" : { "message": "this is a test"}}}
{ }
{"query" : {"match_all" : {}}}
  • Related