SearXNG Search Skill
Search the web using a self-hosted SearXNG instance.
When to Use
- - User asks to search, look something up: "搜索", "搜一下", "查一下", "search for", "look up"
- Need results from multiple engines (Google, Bing, DuckDuckGo, etc.)
- Need news, images, IT/science, or social media search
- INLINECODE0 unavailable or returns poor results
Deployment
Quick Start (Docker Compose)
The docker/ folder in this skill contains a ready-to-use Docker Compose setup. Run it directly — no need to copy files elsewhere.
CODEBLOCK0
Configuration
Edit files in the docker/ folder:
- - Port: Default
127.0.0.1:8888 → change in docker-compose.yml ports section - Engines: Edit
settings.yml engines list (Google, Bing, DuckDuckGo, Wikipedia, GitHub enabled by default) - Language:
default_lang in settings.yml (default: auto)
Troubleshooting
CODEBLOCK1
Usage
All commands use the script at scripts/searxng_search.py (relative to this skill directory). The script defaults to http://127.0.0.1:8888 but accepts --base-url to point elsewhere.
CODEBLOCK2
Categories
| Category | Description |
|---|
| INLINECODE12 | Web search (default) |
| INLINECODE13 |
News articles |
|
images | Image search |
|
videos | Video search |
|
it | IT / programming |
|
science | Scientific articles |
|
files | File search |
|
social media | Social media posts |
Notes
- - SearXNG aggregates and deduplicates results from multiple engines
- The
score field indicates cross-engine ranking confidence - No API key needed — fully self-hosted and private
SearXNG 搜索技能
使用自托管的 SearXNG 实例搜索网络。
使用时机
- - 用户要求搜索、查找内容时:搜索、搜一下、查一下、search for、look up
- 需要从多个搜索引擎(Google、Bing、DuckDuckGo 等)获取结果时
- 需要搜索新闻、图片、IT/科学或社交媒体内容时
- web_search 不可用或返回结果不佳时
部署
快速开始(Docker Compose)
本技能中的 docker/ 文件夹包含可直接使用的 Docker Compose 配置。直接运行即可,无需将文件复制到其他位置。
bash
1. 生成随机密钥
sed -i s/CHANGE
METO
ARANDOM_STRING/$(openssl rand -hex 16)/ docker/settings.yml
2. 启动
docker compose -f docker/docker-compose.yml up -d
3. 验证
curl -s http://127.0.0.1:8888/search?q=test&format=json | python3 -m json.tool | head -5
配置
编辑 docker/ 文件夹中的文件:
- - 端口:默认 127.0.0.1:8888 → 在 docker-compose.yml 的 ports 部分修改
- 搜索引擎:编辑 settings.yml 中的搜索引擎列表(默认启用 Google、Bing、DuckDuckGo、Wikipedia、GitHub)
- 语言:settings.yml 中的 default_lang(默认:auto)
故障排除
bash
检查是否运行
docker ps | grep searxng
重启
docker compose -f docker/docker-compose.yml restart
查看日志
docker logs searxng --tail 50
使用方法
所有命令均使用 scripts/searxng_search.py 脚本(相对于本技能目录)。脚本默认使用 http://127.0.0.1:8888,但可通过 --base-url 参数指定其他地址。
bash
基本搜索
python3 scripts/searxng_search.py 你的查询内容
结果数量
python3 scripts/searxng_search.py 你的查询内容 -n 5
语言
python3 scripts/searxng_search.py 你的查询内容 -l zh # 中文
python3 scripts/searxng_search.py 你的查询内容 -l en # 英文
分类
python3 scripts/searxng_search.py 你的查询内容 -c news
python3 scripts/searxng_search.py 你的查询内容 -c images
python3 scripts/searxng_search.py 你的查询内容 -c it
python3 scripts/searxng_search.py 你的查询内容 -c science
时间筛选
python3 scripts/searxng_search.py 你的查询内容 -t day
python3 scripts/searxng_search.py 你的查询内容 -t week
python3 scripts/searxng_search.py 你的查询内容 -t month
指定搜索引擎
python3 scripts/searxng_search.py 你的查询内容 -e google,bing
JSON 输出
python3 scripts/searxng_search.py 你的查询内容 --json
自定义 SearXNG URL
python3 scripts/searxng_search.py 你的查询内容 --base-url http://192.168.1.100:8888
组合使用
python3 scripts/searxng_search.py 最新科技新闻 -c news -l zh -t week -n 5
分类
新闻文章 |
| images | 图片搜索 |
| videos | 视频搜索 |
| it | IT / 编程 |
| science | 科学文章 |
| files | 文件搜索 |
| social media | 社交媒体帖子 |
注意事项
- - SearXNG 会聚合并去重来自多个搜索引擎的结果
- score 字段表示跨搜索引擎的排名置信度
- 无需 API 密钥 — 完全自托管且保护隐私