115: Add the exhaustiveNbHits in search response body (returns always false) r=curquiza a=irevoire

closes #103 

Co-authored-by: tamo <irevoire@protonmail.ch>
Co-authored-by: Irevoire <irevoire@protonmail.ch>
This commit is contained in:
bors[bot] 2021-03-24 12:16:53 +00:00 committed by GitHub
commit fe87477238
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,6 +41,7 @@ pub struct SearchQuery {
pub struct SearchResult { pub struct SearchResult {
pub hits: Vec<Map<String, Value>>, pub hits: Vec<Map<String, Value>>,
pub nb_hits: u64, pub nb_hits: u64,
pub exhaustive_nb_hits: bool,
pub query: String, pub query: String,
pub limit: usize, pub limit: usize,
pub offset: usize, pub offset: usize,
@ -107,6 +108,7 @@ impl Index {
}; };
let result = SearchResult { let result = SearchResult {
exhaustive_nb_hits: false, // not implemented yet
hits: documents, hits: documents,
nb_hits, nb_hits,
query: query.q.clone().unwrap_or_default(), query: query.q.clone().unwrap_or_default(),