Skip to content

Commit

Permalink
Merge pull request #85 from Urban-Analytics-Technology-Platform/81-se…
Browse files Browse the repository at this point in the history
…arch-improvements

* Search improvements (#81)

* Fix broken pipe (#82)
  • Loading branch information
sgreenbury authored Nov 4, 2024
2 parents b0070d1 + 0998aa8 commit a9b39cb
Show file tree
Hide file tree
Showing 9 changed files with 773 additions and 184 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ jobs:
strategy:
matrix:
platform:
- runner: macos-12
- runner: macos-13
target: x86_64
- runner: macos-14
- runner: macos-15
target: aarch64
steps:
- uses: actions/checkout@v4
Expand Down
25 changes: 19 additions & 6 deletions popgetter/src/data_request_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use serde::{Deserialize, Serialize};

use crate::geo::BBox;
use crate::search::{
DownloadParams, GeometryLevel, MetricId, Params, SearchContext, SearchParams, SearchText,
YearRange,
CaseSensitivity, DownloadParams, GeometryLevel, MatchType, MetricId, Params, SearchConfig,
SearchContext, SearchParams, SearchText, YearRange,
};

#[derive(Serialize, Deserialize, Clone, Debug, Default)]
Expand Down Expand Up @@ -36,6 +36,10 @@ impl TryFrom<DataRequestSpec> for Params {
SearchContext::Hxl,
SearchContext::Description
],
config: SearchConfig {
match_type: MatchType::Regex,
case_sensitivity: CaseSensitivity::Insensitive,
},
}),
_ => None,
})
Expand All @@ -57,11 +61,20 @@ impl TryFrom<DataRequestSpec> for Params {
_ => None,
})
.collect_vec(),
geometry_level: value
.geometry
.as_ref()
.and_then(|geometry| geometry.geometry_level.to_owned().map(GeometryLevel)),
geometry_level: value.geometry.as_ref().and_then(|geometry| {
geometry
.geometry_level
.to_owned()
.map(|geometry_level| GeometryLevel {
value: geometry_level,
config: SearchConfig {
match_type: MatchType::Exact,
case_sensitivity: CaseSensitivity::Insensitive,
},
})
}),
source_data_release: None,
source_download_url: None,
data_publisher: None,
country: None,
source_metric_id: None,
Expand Down
Loading

0 comments on commit a9b39cb

Please sign in to comment.