Everything Search

👤 steve-shi-web 📦 v1.0.0 ⭐ 4.6 ⬇️ 1.2K 下載
📚 知識管理 免費

📖 技能介紹


name: everything-search description: "Everything Windows 檔案搜尋技能 — HTTP API 快速搜尋、中英文模糊匹配、檔案型別過濾" version: "1.0.0" author: Steve-Shi-Web license: MIT keywords: ["files", "search", "windows", "everything", "productivity"]


Everything Search 技能說明

📋 技能概述

通過 Everything HTTP Server API 實現快速檔案搜尋功能。支援中文/英文搜尋、模糊匹配、檔案型別過濾。


🔧 配置步驟

1. 安裝 Everything

  • 下載地址:https://www.voidtools.com/
  • 安裝路徑:D:\Program Files\Everything\

2. 啟用 HTTP 伺服器

⚠️ 關鍵步驟 - 必須手動操作:

  1. 開啟 Everything 視窗
  2. Ctrl+P 開啟選項(或 Tools → Options)
  3. 點選左側 "HTTP Server"
  4. 勾選 ☑ Enable HTTP server
  5. 設定埠:2853
  6. 點選 OK 儲存

3. 驗證配置

# 測試 HTTP 伺服器是否執行
python -c "import urllib.request; r = urllib.request.urlopen('http://127.0.0.1:2853/', timeout=5); print('OK:', r.status)"

⚠️ 注意事項

1. HTTP 伺服器必須手動啟用

問題: 配置檔案不會自動啟用 HTTP 伺服器

原因: Everything 的安全設計,必須在 GUI 介面中手動勾選

解決方案: - 必須在 Everything 視窗中按 Ctrl+P → HTTP Server → 勾選啟用 - 僅修改配置檔案 Everything.ini 不會生效

2. 服務例項 vs 使用者例項

問題: 有時有兩個 Everything 程序執行,其中一個可能不讀取使用者配置

症狀: - 配置已儲存但 HTTP 伺服器不響應 - 埠未被監聽

解決方案: 1. 完全退出 Everything(系統托盤右鍵 → Exit) 2. 重新啟動 Everything 3. 再次確認 HTTP Server 已勾選

3. 配置生效需要重啟

問題: 修改配置後 HTTP 伺服器未立即響應

解決方案: - 修改配置後完全退出並重啟 Everything - 等待 3-5 秒讓服務完全啟動

4. 端口占用檢查

問題: 埠 2853 無法連線

診斷方法:

import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('127.0.0.1', 2853))
if result == 0:
    print("埠開放")
else:
    print("埠關閉")

5. API 端點格式

正確的 API 格式:

http://127.0.0.1:2853/?search=關鍵詞&json=1&maxresults=20

錯誤的 API 格式(會導致 404):

http://127.0.0.1:2853/everything/?search=關鍵詞&json=1
http://127.0.0.1:2853/api/search?query=關鍵詞&json=1

🐛 今天遇到的問題及解決方案

問題 1:HTTP 伺服器無法連線

症狀:

✗ Connection failed: [WinError 10061] 由於目標計算機積極拒絕,無法連線

排查過程: 1. ✓ 確認 Everything 程序在執行(tasklist 檢測到 2 個例項) 2. ✓ 配置檔案已正確寫入 Everything.ini 3. ✗ 埠 2853 未被監聽(netstat 檢查) 4. ✗ 多個常用埠測試(80, 8080, 8081, 8082)均無響應

根本原因: - 配置檔案中的 enabled=1 不會自動啟用 HTTP 伺服器 - 必須在 GUI 介面中手動勾選核取方塊

解決方案: 1. 開啟 Everything 視窗 2. Ctrl+P → HTTP Server 3. 確認 ☑ Enable HTTP server 已勾選 4. 點選 OK 5. 完全退出並重啟 Everything

驗證命令:

python /workspace/check-port.py
# 輸出:✓ Port 2853 is OPEN and listening!

問題 2:API 返回 404

症狀:

✗ Search failed: HTTP Error 404: Not Found

排查過程: 1. ✓ HTTP 伺服器已啟動(埠 2853 可連線) 2. ✓ 根路徑 / 返回正常 HTML 3. ✗ /everything/?search=test 返回 404 4. ✗ /api/search?query=test 返回 404 5. ✓ /?search=test&json=1 返回正常 JSON

根本原因: - Everything HTTP API 的端點是根路徑 /,不是 /everything/

解決方案: 使用正確的 API 格式:

http://127.0.0.1:2853/?search=關鍵詞&json=1&maxresults=20

問題 3:檔案大小顯示為 0

症狀: - 搜尋結果中所有檔案大小都顯示為 0 B

原因: - Everything 預設不返回檔案大小資訊 - 需要在 API 請求中新增引數

解決方案: 在 API URL 中新增 &size=1 引數:

http://127.0.0.1:2853/?search=關鍵詞&json=1&size=1&maxresults=20

問題 4:中文搜尋亂碼

症狀: - 搜尋中文關鍵詞返回空結果或錯誤

原因: - URL 中的中文需要 URL 編碼

小蔥技能7w4.net有完整的技能分類。

解決方案: 使用 urllib.parse.quote() 編碼中文:

import urllib.parse
keyword = "資料資產"
encoded = urllib.parse.quote(keyword)
url = f"http://127.0.0.1:2853/?search={encoded}&json=1"

📝 使用示例

Python 搜尋指令碼

#!/usr/bin/env python3
import urllib.request
import urllib.parse
import json

PORT = 2853
KEYWORD = "資料資產"

# 編碼關鍵詞
encoded = urllib.parse.quote(KEYWORD)
url = f"http://127.0.0.1:{PORT}/?search={encoded}&json=1&maxresults=20"

# 傳送請求
req = urllib.request.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0')

with urllib.request.urlopen(req, timeout=10) as response:
    data = json.loads(response.read().decode())

    total = data.get("totalResults", 0)
    results = data.get("results", [])

    print(f"找到 {total} 個結果")

    for item in results[:10]:
        name = item.get("name", "Unknown")
        path = item.get("path", "")
        full_path = f"{path}\\{name}" if path else name
        print(f"  - {full_path}")

搜尋圖片檔案

# 搜尋特定型別的檔案
keywords = [
    "張三 jpg",      # 搜尋 JPG 照片
    "張三 png",      # 搜尋 PNG 圖片
    "資料資產 xlsx",   # 搜尋 Excel 檔案
    "報告 pdf",        # 搜尋 PDF 文件
]

for keyword in keywords:
    encoded = urllib.parse.quote(keyword)
    url = f"http://127.0.0.1:2853/?search={encoded}&json=1&maxresults=10"
    # ... 處理結果

🔍 高階搜尋語法

檔案型別過濾

# 只搜尋檔案(不包括資料夾)
關鍵詞 file:

# 只搜尋資料夾
關鍵詞 folder:

# 搜尋特定副檔名
關鍵詞 ext:jpg
關鍵詞 ext:png

路徑過濾

# 在特定路徑中搜索
關鍵詞 path:"D:\Documents"

# 排除特定路徑
關鍵詞 !path:"C:\Windows"

大小過濾

# 大於 1MB 的檔案
關鍵詞 size:>1mb

# 小於 100KB 的檔案
關鍵詞 size:<100kb

日期過濾

# 今天修改的檔案
關鍵詞 dm:today

# 本週修改的檔案
關鍵詞 dm:thisweek

# 特定日期之後修改的檔案
關鍵詞 dm:>2024-01-01

🛠️ 診斷工具

檢查埠狀態

# check-port.py
import socket

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(3)
result = sock.connect_ex(('127.0.0.1', 2853))

if result == 0:
    print("✓ Port 2853 is OPEN")
else:
    print("✗ Port 2853 is CLOSED")

測試 API 端點

# test-api.py
import urllib.request

endpoints = [
    "/",
    "/?search=test&json=1",
    "/version",
]

for endpoint in endpoints:
    url = f"http://127.0.0.1:2853{endpoint}"
    try:
        with urllib.request.urlopen(url, timeout=5) as r:
            print(f"✓ {endpoint} - {r.status}")
    except Exception as e:
        print(f"✗ {endpoint} - {e}")

📚 參考資料

  • Everything 官方文件:https://www.voidtools.com/support/everything/
  • HTTP Server 配置:https://www.voidtools.com/support/everything/http_server/
  • 搜尋語法:https://www.voidtools.com/support/everything/search_commands/

📅 更新日誌

2026-04-02

  • ✅ 批次替換敏感人名"史周平"為"張三"(共 14 處)
  • ✅ 更新 badges 為現代 flat-square 樣式
  • ✅ 設定倉庫為公開可見
  • ✅ 更新聯絡方式:問題反饋由 GitHub Issues 更改為 441457345@qq.com

2024-04-02

  • ✅ 完成 Everything HTTP Server 配置
  • ✅ 解決 HTTP 伺服器無法連線問題(需手動勾選啟用)
  • ✅ 解決 API 404 錯誤(使用正確的端點格式)
  • ✅ 測試中文搜尋功能
  • ✅ 建立診斷工具和測試指令碼

🎯 快速檢查清單

配置 Everything 後,按此清單檢查:

  • [ ] Everything 正在執行
  • [ ] HTTP Server 已勾選啟用(Ctrl+P → HTTP Server → ☑ Enable)
  • [ ] 埠設定為 2853
  • [ ] 完全退出並重啟了 Everything
  • [ ] 埠 2853 可連線(執行 check-port.py 驗證)
  • [ ] API 返回正常 JSON(執行 test-api.py 驗證)
  • [ ] 中文搜尋正常工作

最後更新: 2026-04-02
作者: nanobot
版本: 1.0

🤖 AI 評測

這個 Skill 質量較好,文件非常詳細貼心,功能實用,支援中文搜尋和多種過濾條件。最大的優點是提供了配置檢查和故障排查工具,遇到問題能快速定位。不過它只能在 Windows 上使用(依賴 Everything 軟體),如果你是 Mac 或 Linux 使用者就無法使用了。另外文件中有個別示例檔名寫錯了,可能會讓新手困惑。

📊 多維度評分

適應性4.5
規範性4.6
有效性4.7
可靠性4.2
可信度4.9

📁 包含檔案 (20 個)

📄 README.md 5.8 KB
📄 SKILL.md 8.9 KB
📄 _meta.json 136 B
📄 docs/api-reference.md 9.2 KB
📄 docs/configuration.md 4.3 KB
📄 docs/troubleshooting.md 7.5 KB
📄 examples/advanced_search.py 2.9 KB
📄 examples/basic_search.py 1.9 KB
📄 examples/batch_search.py 1.7 KB
📄 examples/search_photos.py 2.1 KB
📄 requirements.txt 439 B
📄 scripts/check-config.py 4.4 KB
📄 scripts/diagnose.py 9.3 KB
📄 scripts/test-api.py 1.3 KB
📄 src/__init__.py 390 B
📄 src/everything_search.py 8.7 KB
📄 src/utils.py 2.9 KB
📄 tests/__init__.py 47 B
📄 tests/test_search.py 3.2 KB
📄 tests/test_utils.py 2.6 KB