aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2021-04-09 18:48:50 -0700
committerBryan Newbold <bnewbold@archive.org>2021-04-09 18:48:52 -0700
commit289fc3e22866ba36c50bd41bb33efdbcb41bf41b (patch)
treea362f0d49fd273c744765635b6b88996c7946b71
parent00b5fc3a1ece56936fbeeefb25a7bf978da6204e (diff)
downloadfatcat-cli-289fc3e22866ba36c50bd41bb33efdbcb41bf41b.tar.gz
fatcat-cli-289fc3e22866ba36c50bd41bb33efdbcb41bf41b.zip
search changes for ES 7.x
search.fatcat.wiki has upgraded
-rw-r--r--fatcat-cli/src/search.rs3
1 files changed, 2 insertions, 1 deletions
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(),