12个版本
| 0.1.11 | 2023年11月9日 |
|---|---|
| 0.1.10 | 2023年10月3日 |
| 0.1.9 | 2023年9月1日 |
| 0.1.8 | 2023年8月28日 |
#1286 in 文本处理
78 每月下载量
31KB
538 代码行
文件搜索
索引和搜索文件内容(xlsx, csv, pdf)
端点
索引
POST http://localhost:8080/index
{
"file_path": "/home/nordine/test.xlsx"
}
搜索
GET http://localhost:8080/search?page=0&per_page=10&q=sango&query_type=regexQuery
环境变量
| env | 默认值 |
|---|---|
| SERVICE_COLLECTION_NAME | file-search |
| SERVICE_HOST | 0.0.0.0 |
| SERVICE_PORT | 8080 |
| INDEX_DIR_PATH | /tmp/__tantivy_data |
| RUST_LOG | N/A |
| INDEX_WRITER_SIZE | 50000000 (50MB) |
安装
- 使用最新版本的安装脚本
- 创建文件
/etc/systemd/system/file-search.service并粘贴以下内容
[Unit]
Description=File Index Search service
After=network.target
StartLimitIntervalSec=0
[Service]
Environment=RUST_LOG=debug
Environment=INDEX_DIR_PATH=<your-home>/.tantivy_data
Type=simple
Restart=always
RestartSec=1
User=<your-user>
ExecStart=<your-home>/.cargo/bin/file-search
[Install]
WantedBy=multi-user.target
- 启动服务:
sudo systemctl start file-search - 检查日志:
sudo journalctl -f -u file-search
依赖项
~59MB
~881K SLoC