I am currently using the Elasticsearch client for .NET, The version I am using is 8.10
the way I query the information with “MultiSearchAsync” is as follows:
Query[] collectionQuerys = new Query[]
{
new MatchQuery(new Field("amount")) { Query = operationAmount },
new MatchQuery(new Field("service.trackingId.keyword")) { Query = serviceTrackingId },
new MatchQuery(new Field("dueDate")) { Query = dueDate },
};
BoolQuery boolQuery = new BoolQuery { Must = collectionQuerys };
listSearchRequestItems.Add(
new SearchRequestItem(
new MultisearchHeader { Index = elasticIndex },
new MultisearchBody { Query = boolQuery }));
}
MultiSearchRequestDescriptor<DirectDebitPaymentResponse> msrd = new MultiSearchRequestDescriptor<DirectDebitPaymentResponse>();
listSearchRequestItems.ForEach(item =>
{
msrd.AddSearch(item);
});
Elastic.Clients.Elasticsearch.MultiSearchResponse<DirectDebitPaymentResponse> multiSearchResponse = await this.elasticsearchClient.MultiSearchAsync(msrd);
I have problems obtaining the responses since it appears to me that the members are not public.
Can you help me with an example of how to do it, please?