fix(search): repair SearXNG engine failures

- bing: www.bing.com 302-redirects to cn.bing.com and SearXNG engine
  requests do not follow redirects, so it parsed the 178-byte redirect
  page and returned 0 results without any error report. Point bing at
  https://cn.bing.com to bypass the redirect.
- Raise outgoing request_timeout 3.0 -> 8.0 and max_request_timeout
  4.0 -> 15.0. max_request_timeout overrides each engine's own timeout,
  so 360search (timeout 20s) was still cut off at 4s.
- Enable duckduckgo (verified working) and disable baidu/sogou which
  return 302 verification pages (baidu also hits a 1h CAPTCHA ban, and
  sogou raises AttributeError on SXNG_Response.next_request).
- Document the diagnosis in the README FAQ.
This commit is contained in:
JianFeeeee
2026-09-11 10:26:32 +08:00
parent e48fcc53cd
commit 88e23861fe
2 changed files with 26 additions and 7 deletions

View File

@ -485,7 +485,17 @@ data/
## 常见问题
**搜索无结果**:确认容器能访问搜索引擎。国内服务器建议只启用百度/Bing中国/搜狗。
**搜索无结果**:确认容器能访问搜索引擎。
- 国内服务器通常需要代理才能出网:SearXNG 不读 `http_proxy` 环境变量,
必须在 `searxng-settings.yml` 的 `outgoing.proxies` 里配置(见文件内注释)。
- **Bing 结果异常少**:`www.bing.com` 会 302 跳到 `cn.bing.com`,而 SearXNG
引擎请求不跟随重定向,只会解析跳转页得到 0 条且不报错。已在默认配置里把
bing 的 `base_url` 指向 `https://cn.bing.com` 绕开该重定向。
- **引擎大面积超时**:`outgoing.max_request_timeout` 会覆盖每个引擎自己的
`timeout`。默认配置已放宽到 `request_timeout: 8.0` / `max_request_timeout: 15.0`,
经代理访问时不要再调回 3/4 秒。
- 百度与搜狗会返回 302 验证页(并触发引擎 1 小时封禁),默认已关闭。
**管理后台 401**:设置了 `NAVI_ADMIN_TOKEN` 时需携带 Bearer token。

View File

@ -19,8 +19,10 @@ ui:
redis:
url: false
outgoing:
request_timeout: 3.0
max_request_timeout: 4.0
# 走代理时握手与回源更慢。默认 3.0 / 4.0 会把一批引擎直接判为超时:
# max_request_timeout 会覆盖单引擎 timeout,360search 配了 20s 仍会在 4s 被砍。
request_timeout: 8.0
max_request_timeout: 15.0
pool_connections: 100
pool_maxsize: 20
# SearXNG curl_cffi 只认这个配置(不走 http_proxy 环境变量)
@ -33,9 +35,11 @@ engines:
disabled: false
- name: bing
disabled: false
- name: baidu
disabled: false
- name: sogou
# www.bing.com 会 302 跳到 cn.bing.com,而 SearXNG 引擎请求不跟随重定向
# (allow_redirects=False)。结果只解析 178 字节的跳转页 -> 0 条且不报错,
# 表现为「Bing 结果异常少」。直接指向 cn.bing.com 可绕开重定向。
base_url: https://cn.bing.com
- name: duckduckgo
disabled: false
- name: 360search
disabled: false
@ -47,7 +51,12 @@ engines:
disabled: false
- name: pypi
disabled: false
- name: duckduckgo
# 实测上游不可用,默认关闭以避免无谓等待与错误日志:
# baidu -> 302 跳验证页(CAPTCHA,命中后引擎被封 1 小时)
# sogou -> 302 + 引擎自身 AttributeError('SXNG_Response' has no attribute 'next_request')
- name: baidu
disabled: true
- name: sogou
disabled: true
- name: startpage
disabled: true