Reputation: 4247
I have elastic multi-search query that returns me 3 list of documents.
The response in sense looks like:
{
"responses": [
{
...
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
},
{
...
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
},
{
...
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}
]
}
I get the 3 list of documents in c# through "results.GetResponses()".
But i don't know how can i get the total of each list? i.e. total count?
Upvotes: 0
Views: 680
Reputation: 13536
You can sum all the responses total
properties:
response.GetResponses<object>().Sum(r=>r.HitsMetaData.Total);
Upvotes: 1