Multi Search request taking longer than expected

Hi,

I am running elasticsearch on my local machine. I have indexed some data on an index.

I want to do multisearch request to do a match request.

For this I am using msearch and in msearch body I am appending 20000 match requests.

{ index: 'index_mydata', type: 'mydata' },
{
query: {
match: {
"indexed_key": "some unique value"
}
}
},
{
query: {
match: {
"indexed_key": "some unique value"
}
}
},
{
query: {
match: {
"indexed_key": "some unique value"
}
}
},
...........................
.............................
...................................

I am adding these requests in bodyArr then passing to msearch as below.

const response = await client.msearch({
body: bodyArr
});

here bodyArr contains 20000 unique match request.

It is executing without any error but taking 30 seconds to complete all requests.

Is it the right approach for multi search request. Or there are some other efficient way to do multisearch.

Note:

I have not touched any elasticsearch configuration on my local machine. It is all default configuration provided by elasticsearch.

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