Closed mwalker9 closed 3 years ago
@mwalker9 Thanks for flagging this. Elasticsearch changed its API for delivering hit counts, and we adjusted our code to handle it but we need to update the Swagger docs to reflect that.
@mwalker9
FYI, our code always requests track_total_hits
, which is less efficient but always returns the true hit count, even above 10,000 hits.
So hits.total.value
should return what you were used to seeing in hits.total
, and you can ignore Elasticsearch's "relation" value.
Thank you for the info @higs4281
There seems to be a discrepancy between the Swagger documentation and the actual response object. The documentation indicates that Hits.total should parse as an integer.
In practice, for the
/
endpoint, I found that hits.total is an object that looks something like this:Example API call:
www.consumerfinance.gov/data-research/consumer-complaints/search/api/v1/?date_received_max=2021-09-15&date_received_min=2021-09-14