I'm working on updating code to handle an update from ElasticSearch 6 to 7. This version changes how the total number of hits works (documentation). I'm new to using this library and am having difficulty seeing how I can use the NEST API to set rest_total_hits_as_int as a request parameter.
I see that the selector
parameter has a RequestConfiguration
method. But, the RequestConfigurationDescriptor
class makes no mention of this request parameter.
I have searched PRs in the ElasticSearch.Net GitHub repo for rest_total_hits_as_int
and TotalHits
(hoping to find a commit where the option to specify this request parameter was added), but I did not find anything helpful.
Can anyone provide assistance on how to set this request parameter in C#?
It's available on the search API in NEST 7.x
or
Both produce
One thing to note is that
rest_total_hits_as_int
doesn't really make any difference to the high level client - It controls the JSON structure for how total hits is returned in the response, but NEST 7.x deserializes both JSON number and JSON object to the same type. NEST 7.x must be used with Elasticsearch 7.x.