Skip to content

Commit

Permalink
added more logging around searches
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Jun 18, 2024
1 parent 2e9e66e commit 6ff7124
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/main-api/src/search/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::time::Instant;

use actix_web::{get, web, HttpResponse};
use cached::proc_macro::cached;
use log::{debug, error};
use serde::{Deserialize, Serialize};
use unicode_truncate::UnicodeTruncateStr;

Expand Down Expand Up @@ -83,9 +84,12 @@ pub async fn search_handler(web::Query(args): web::Query<SearchQueryArgs>) -> Ht
let limits = Limits::from(&args);
let highlighting = Highlighting::from(&args);
let q = args.q;
debug!("searching for {q} with a limit of {limits:?} and highlighting of {highlighting:?}");
let results_sections = cached_geoentry_search(q, highlighting, limits).await;
debug!("searching returned {results_sections:?}");

if results_sections.len() != 2 {
error!("searching returned {len} sections, but expected 2", len=results_sections.len());
return HttpResponse::InternalServerError().body("Internal error");
}
let search_results = SearchResults {
Expand Down

0 comments on commit 6ff7124

Please sign in to comment.