diff --git a/http-ui/public/script.js b/http-ui/public/script.js index 58fc74eab..3071f78ac 100644 --- a/http-ui/public/script.js +++ b/http-ui/public/script.js @@ -26,7 +26,7 @@ $('#query, #facet').on('input', function () { let timeSpent = request.getResponseHeader('Time-Ms'); let numberOfDocuments = data.documents.length; - count.innerHTML = `${numberOfDocuments}`; + count.innerHTML = data.numberOfCandidates.toLocaleString(); time.innerHTML = `${timeSpent}ms`; time.classList.remove('fade-in-out'); diff --git a/http-ui/src/main.rs b/http-ui/src/main.rs index fe2f71c8e..46f81ab5e 100644 --- a/http-ui/src/main.rs +++ b/http-ui/src/main.rs @@ -633,6 +633,7 @@ async fn main() -> anyhow::Result<()> { #[serde(rename_all = "camelCase")] struct Answer { documents: Vec>, + number_of_candidates: u64, facets: HashMap>, } @@ -659,6 +660,7 @@ async fn main() -> anyhow::Result<()> { let SearchResult { found_words, candidates, documents_ids } = search.execute().unwrap(); + let number_of_candidates = candidates.len(); let facets = if query.facet_distribution == Some(true) { Some(index.facets(&rtxn).candidates(candidates).execute().unwrap()) } else { @@ -690,6 +692,7 @@ async fn main() -> anyhow::Result<()> { let answer = Answer { documents, + number_of_candidates, facets: facets.unwrap_or_default(), }; diff --git a/http-ui/templates/index.html b/http-ui/templates/index.html index 49d36bb65..20de4884a 100644 --- a/http-ui/templates/index.html +++ b/http-ui/templates/index.html @@ -66,7 +66,7 @@