mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Handle cases where no organic online search results found
Previous organic results enumerator only handled the scenario where organic key wasn't present in online search results. It did not handle the case where there were no organic online search results.
This commit is contained in:
@@ -148,7 +148,7 @@ async def search_online(
|
||||
for subquery in response_dict:
|
||||
if "answerBox" in response_dict[subquery]:
|
||||
continue
|
||||
for idx, organic in enumerate(response_dict[subquery].get("organic", [])):
|
||||
for idx, organic in enumerate(response_dict[subquery].get("organic") or []):
|
||||
link = organic.get("link")
|
||||
if link in webpages and idx < max_webpages_to_read:
|
||||
webpages[link]["queries"].add(subquery)
|
||||
|
||||
Reference in New Issue
Block a user