Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #118 from climatepolicyradar/feature/pdct-729-fix-…
Browse files Browse the repository at this point in the history
…keyword-errors

Fix country & region filtering
  • Loading branch information
olaughter authored Jan 10, 2024
2 parents f9c8b5c + 5f14a56 commit ac2e2ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cpr_data_access/vespa.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ def build_yql(request: SearchParameters, sensitive: bool = False) -> str:
for field_name, values in request.keyword_filters.items():
for value in values:
filters.append(f'({field_name} contains "{sanitize(value)}")')
rendered_filters = " and " + " and ".join(filters)
if filters:
rendered_filters = f" and ({' or '.join(filters)})"

if request.year_range:
start, end = request.year_range
Expand Down

0 comments on commit ac2e2ce

Please sign in to comment.