Skip to content

Commit

Permalink
made sure that adress search returns recognisable IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Dec 14, 2024
1 parent 1411c7e commit 4ccd4ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions server/src/search/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ async fn cached_geoentry_search(
let ms_url = std::env::var("MIELI_URL").unwrap_or_else(|_| "http://localhost:7700".to_string());
let Ok(client) = Client::new(ms_url, std::env::var("MEILI_MASTER_KEY").ok()) else {
error!("Failed to create a meilisearch client");
if search_addresses {
return search_executor::address_search(&q).await.0;
return if search_addresses {
search_executor::address_search(&q).await.0
} else {
return vec![];
vec![]
}
};
let geoentry_search = search_executor::do_geoentry_search(&client, &q, highlighting, limits);
Expand Down
2 changes: 1 addition & 1 deletion server/src/search/search_executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ pub async fn address_search(q: &str) -> LimitedVec<ResultsSection> {
let subtext = r.address.serialise();
ResultEntry {
hit: Default::default(),
id: r.osm_id.to_string(),
id: format!("osm_{}", r.osm_id),
r#type: r.address_type,
name: r.address.road.unwrap_or(r.name),
subtext,
Expand Down

0 comments on commit 4ccd4ec

Please sign in to comment.