Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update utils.py - remove prefix wildcards #822

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mcweb/backend/search/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ def _for_media_cloud(collections: List, sources: List, all_params: Dict) -> Dict
and s.name not in domains]
sources_with_url_search_strs += [s for s in selected_sources_in_collections if bool(s.url_search_string) is not False
and s.name not in domains]
domain_url_filters = ["(canonical_domain:{} AND url:*{}*)".format(s.name, s.url_search_string)

domain_url_filters = [f"(canonical_domain:{s.name} AND (url:http\://{s.url_search_string} OR url:https\://{s.url_search_string}))"
for s in sources_with_url_search_strs]
# 3. assemble and add in other supported params
supported_extra_props = ['pagination_token', 'page_size', 'sort_field', 'sort_order',
Expand Down