mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-06 06:52:20 +02:00
Separate current reference lookups from publication date restrictions
This commit is contained in:
@@ -720,7 +720,7 @@ def searxng_search_results(query: str, count: int = 10, time_filter: str = None)
|
||||
# first instead of spending the full tool deadline retrying generic search
|
||||
# providers; the returned official URL lets the agent proceed to PDF tools.
|
||||
scholarly_title = _scholarly_title_from_query(provider_query)
|
||||
if scholarly_title:
|
||||
if scholarly_title and not time_filter:
|
||||
direct_results = [result for result in _direct_scholarly_title_results(scholarly_title, count)
|
||||
if _result_matches_site_scope(provider_query, result)]
|
||||
if direct_results:
|
||||
|
||||
@@ -220,14 +220,12 @@ def searxng_search_api(query: str, count: Optional[int] = None, categories: str
|
||||
if is_news and categories == "general":
|
||||
params["categories"] = "news"
|
||||
if time_filter in ("day", "week", "month", "year"):
|
||||
# 'day' is too sparse on most SearXNG news engines — widen to a week
|
||||
# so there's enough volume; the news category already biases recent.
|
||||
params["time_range"] = "week" if time_filter in ("day", "week") else time_filter
|
||||
params["time_range"] = time_filter
|
||||
else:
|
||||
params["categories"] = categories
|
||||
# Freshness and source category are independent: current manuals,
|
||||
# comparisons and documentation still belong in general search.
|
||||
if not is_software_release_query and time_filter in ("day", "week", "month", "year"):
|
||||
if time_filter in ("day", "week", "month", "year"):
|
||||
params["time_range"] = time_filter
|
||||
# Route general queries to engines that aren't blocked (default general
|
||||
# set returns 0 on this instance — see _GENERAL_ENGINES).
|
||||
|
||||
Reference in New Issue
Block a user