Harden private search fallback and freshness handling
This commit is contained in:
@@ -20,3 +20,13 @@ server:
|
||||
outgoing:
|
||||
request_timeout: 8.0
|
||||
max_request_timeout: 15.0
|
||||
|
||||
# Several default general-purpose engines aggressively block datacenter IPs.
|
||||
# Bing is disabled in SearXNG's upstream defaults but works reliably from the
|
||||
# Athena egress path. Explicitly enabling it gives the private metasearch a
|
||||
# useful primary engine while the others remain independent fallbacks.
|
||||
engines:
|
||||
- name: bing
|
||||
engine: bing
|
||||
shortcut: bi
|
||||
disabled: false
|
||||
|
||||
@@ -1614,6 +1614,7 @@ def web_search(arguments: dict[str, Any]) -> dict[str, Any]:
|
||||
)
|
||||
results: list[dict[str, Any]] = []
|
||||
backend_warning = None
|
||||
freshness_applied = freshness == "any"
|
||||
if backend in {"github", "huggingface"}:
|
||||
try:
|
||||
results.extend(specialized_search(backend, query, limit))
|
||||
@@ -1626,6 +1627,14 @@ def web_search(arguments: dict[str, Any]) -> dict[str, Any]:
|
||||
results.extend(parse_search_xml(payload, limit))
|
||||
else:
|
||||
discovered, discovery_warnings = general_discovery(scoped_query, limit, freshness)
|
||||
freshness_applied = freshness == "any" or bool(discovered)
|
||||
if not discovered and freshness != "any":
|
||||
discovered, relaxed_warnings = general_discovery(scoped_query, limit, "any")
|
||||
discovery_warnings.extend(relaxed_warnings)
|
||||
if discovered:
|
||||
discovery_warnings.append(
|
||||
f"No results survived freshness={freshness}; returned unfiltered discovery results. Verify publication dates before claiming recency."
|
||||
)
|
||||
results.extend(discovered)
|
||||
if discovery_warnings:
|
||||
backend_warning = "; ".join(discovery_warnings)
|
||||
@@ -1636,6 +1645,7 @@ def web_search(arguments: dict[str, Any]) -> dict[str, Any]:
|
||||
"query": query,
|
||||
"backend_used": backend,
|
||||
"freshness": freshness,
|
||||
"freshness_applied": freshness_applied,
|
||||
"domain_filters": {"include": includes, "exclude": excludes},
|
||||
"result_semantics": (
|
||||
"api_verified evidence comes from the named primary API. preview_unverified is "
|
||||
|
||||
Reference in New Issue
Block a user