From 289fc3e22866ba36c50bd41bb33efdbcb41bf41b Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 9 Apr 2021 18:48:50 -0700 Subject: search changes for ES 7.x search.fatcat.wiki has upgraded --- fatcat-cli/src/search.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fatcat-cli/src/search.rs b/fatcat-cli/src/search.rs index 88361c5..e4f7dce 100644 --- a/fatcat-cli/src/search.rs +++ b/fatcat-cli/src/search.rs @@ -140,6 +140,7 @@ pub fn crude_search( }, "size": size, "sort": [ sort_mode ], + "track_total_hits": true, }) .to_string(); @@ -169,7 +170,7 @@ pub fn crude_search( Ok(SearchResults { entity_type, limit, - count: body["hits"]["total"].as_u64().unwrap(), + count: body["hits"]["total"]["value"].as_u64().unwrap(), took_ms: body["took"].as_u64().unwrap(), offset: 0, batch: body["hits"]["hits"].as_array().unwrap().to_vec(), -- cgit v1.2.3