Add searchapi as an alternative web search

Add config changes for SearchApi api key and engine

Add searchapi results json in testdata
This commit is contained in:
Rajendra Kadam committed 2024-08-28 15:26:33 +05:30
1 parent 6589450bd6
commit 7e1923fcfe
7 files changed
+504 -2

No files matched your search

+2 -1
View File
@@ -8,7 +8,8 @@ def get_filtered_results(results, filter_list):
return results
filtered_results = []
for result in results:
domain = urlparse(result["url"]).netloc
url = result.get("url") or result.get("link", "")
domain = urlparse(url).netloc
if any(domain.endswith(filtered_domain) for filtered_domain in filter_list):
filtered_results.append(result)
return filtered_results