ワンクリックで
doc-indexer
文件索引與全文搜尋工具。使用 /doc-indexer search "關鍵字" 搜尋文件,/doc-indexer index "目錄" 建立索引。支援 PDF, Word, Excel, 圖片 OCR,中文分詞,分頁索引。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
文件索引與全文搜尋工具。使用 /doc-indexer search "關鍵字" 搜尋文件,/doc-indexer index "目錄" 建立索引。支援 PDF, Word, Excel, 圖片 OCR,中文分詞,分頁索引。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | doc-indexer |
| description | 文件索引與全文搜尋工具。使用 /doc-indexer search "關鍵字" 搜尋文件,/doc-indexer index "目錄" 建立索引。支援 PDF, Word, Excel, 圖片 OCR,中文分詞,分頁索引。 |
| allowed-tools | ["Bash","Read","Write"] |
文件索引與全文搜尋工具,使用 Apache Tika 提取文件內容,Apache Lucene 建立全文索引。
使用以下命令執行 doc-indexer:
export JAVA_HOME=/Users/jrjohn/Library/Java/JavaVirtualMachines/ms-17.0.16/Contents/Home && java -jar /Users/jrjohn/Documents/projects/doc_index/doc-indexer/build/libs/doc-indexer-1.0.0-all.jar <command> [options]
可用命令: index, search, list, stats, read, clear
/Users/jrjohn/Documents/projects/doc_index/doc-indexer/build/libs/doc-indexer-1.0.0-all.jar
需要使用 Java 17 執行:
export JAVA_HOME=/Users/jrjohn/Library/Java/JavaVirtualMachines/ms-17.0.16/Contents/Home
java -jar doc-indexer-1.0.0-all.jar index <目錄或檔案路徑> [選項]
參數:
| 參數 | 說明 | 預設值 |
|---|---|---|
<path> | 要索引的目錄或檔案路徑 | (必填) |
-i, --index-dir | 索引儲存目錄 | ./index-data |
-m, --max-size | 最大檔案大小 (MB),超過則跳過 | 20 |
-r, --recursive | 是否遞迴處理子目錄 | true |
--json | 以 JSON 格式輸出 | false |
範例:
# 索引指定目錄 (預設最大 20MB)
java -jar doc-indexer-1.0.0-all.jar index "/Users/jrjohn/Documents/個人"
# 指定索引儲存位置
java -jar doc-indexer-1.0.0-all.jar index "/path/to/docs" -i "/path/to/index"
# 設定最大檔案大小為 50MB
java -jar doc-indexer-1.0.0-all.jar index "/path/to/docs" -m 50
# 設定最大檔案大小為 10MB,並指定索引位置
java -jar doc-indexer-1.0.0-all.jar index "/path/to/docs" -m 10 -i "/path/to/index"
java -jar doc-indexer-1.0.0-all.jar search <關鍵字> [選項]
參數:
| 參數 | 說明 | 預設值 |
|---|---|---|
<query> | 搜尋關鍵字 | (必填) |
-i, --index-dir | 索引目錄 | ./index-data |
-n, --max-results | 最大結果數量 | 30 |
--json | 以 JSON 格式輸出 | false |
輸出欄位:
範例:
# 搜尋關鍵字
java -jar doc-indexer-1.0.0-all.jar search "妄尽还源观"
# 限制結果數量
java -jar doc-indexer-1.0.0-all.jar search "地藏" -n 10
# JSON 輸出
java -jar doc-indexer-1.0.0-all.jar search "佛經" --json
java -jar doc-indexer-1.0.0-all.jar list [選項]
參數:
| 參數 | 說明 | 預設值 |
|---|---|---|
-i, --index-dir | 索引目錄 | ./index-data |
-n, --max-results | 最大結果數量 | 100 |
--json | 以 JSON 格式輸出 | false |
java -jar doc-indexer-1.0.0-all.jar stats [選項]
輸出:
java -jar doc-indexer-1.0.0-all.jar read <檔案路徑> [選項]
參數:
| 參數 | 說明 | 預設值 |
|---|---|---|
<path> | 檔案路徑 | (必填) |
-l, --limit | 內容長度限制 | 5000 |
--json | 以 JSON 格式輸出 | false |
java -jar doc-indexer-1.0.0-all.jar clear [選項]
參數:
| 參數 | 說明 | 預設值 |
|---|---|---|
-i, --index-dir | 索引目錄 | ./index-data |
-f, --force | 強制清除 (不確認) | false |
pdf)doc, docx)xls, xlsx)ppt, pptx)odt, ods, odp)rtf)txt, md, markdown)json)xml)yaml, yml)html, htm)csv, tsv)支援 Lucene 查詢語法:
| 語法 | 說明 | 範例 |
|---|---|---|
| 單詞 | 搜尋單一關鍵字 | 佛經 |
| 詞組 | 用引號包圍搜尋詞組 | "心經" |
| AND | 同時包含 | 佛經 AND 般若 |
| OR | 任一包含 | 心經 OR 金剛經 |
| NOT | 排除 | 佛經 NOT 阿彌陀 |
| 萬用字元 | * 多字元, ? 單字元 | 佛* |
| 欄位搜尋 | 指定欄位 | fileName:心經 |
搜尋時欄位權重:
/Users/jrjohn/Documents/projects/doc_index/doc-indexer/
cd /Users/jrjohn/Documents/projects/doc_index/doc-indexer
export JAVA_HOME=/Users/jrjohn/Library/Java/JavaVirtualMachines/ms-17.0.16/Contents/Home
./gradlew shadowJar --no-daemon
Android development guide based on Arcana Android enterprise architecture. Provides comprehensive support for Clean Architecture, Offline-First design, Jetpack Compose, Hilt DI, and MVVM Input/Output pattern. Suitable for Android project development, architecture design, code review, and debugging.
Angular development guide based on Arcana Angular enterprise architecture. Provides comprehensive support for Clean Architecture, Offline-First design with 4-layer caching, Angular Signals, MVVM Input/Output/Effect pattern, and enterprise security. Suitable for Angular project development, architecture design, code review, and debugging.
ESP32-S3 IoT development guide based on Arcana Embedded ESP32 production-ready IoT command platform. Provides comprehensive support for BLE dual-role (GATT Server/Client via Bluedroid), AES-256-CCM encryption with ECDH P-256 key exchange, Observable sensor pattern, nanopb protobuf, Arcana Frame Protocol, MQTT5, and WiFi+BLE coexistence on FreeRTOS. Suitable for ESP32-S3 firmware development, architecture design, security review, and debugging.
Go development guide based on Arcana Cloud Go enterprise architecture. Provides comprehensive support for Clean Architecture, fx (Uber) DI, gRPC-first communication (1.80x faster), dual-protocol support (gRPC/REST via Gin), multi-database DAO layer (MySQL/PostgreSQL/MongoDB via GORM), Viper config, zap logging, Plugin System, SSR Engine, Background Jobs, and 5 deployment modes. Suitable for Go microservices development, architecture design, code review, and debugging.
HarmonyOS 5 (NEXT) development guide based on Arcana HarmonyOS enterprise architecture. Provides comprehensive support for Clean Architecture (four-layer), Offline-First design, ArkTS strict mode, ArkUI declarative UI, InversifyJS-style DI, MVVM Input/Output/Effect pattern, HUKS security, and WorkScheduler background sync. Suitable for HarmonyOS project development, architecture design, code review, and debugging.
iOS development guide based on Arcana iOS enterprise architecture. Provides comprehensive support for Clean Architecture, Offline-First design, SwiftUI, SwiftData, and MVVM Input/Output/Effect pattern. Suitable for iOS project development, architecture design, code review, and debugging.