## v0.9.20260325_144654 ### Features - API Key Authentication System - Job Worker System - V2 Backup Versioning ### Bug Fixes - get_processor_results_by_job column mapping Co-authored-by: OpenCode
122 lines
2.0 KiB
Markdown
122 lines
2.0 KiB
Markdown
# 搜尋範例 Prompt
|
|
|
|
## 基本搜尋測試
|
|
|
|
### 1. 簡單關鍵字搜尋
|
|
```bash
|
|
curl -X POST http://localhost:3002/api/v1/search \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"query": "charade", "limit": 5}'
|
|
```
|
|
|
|
### 2. 電影相關詞
|
|
```
|
|
charade
|
|
woody allen
|
|
audrey hepburn
|
|
classic movie
|
|
old time movie
|
|
romantic comedy
|
|
```
|
|
|
|
### 3. 場景描述
|
|
```
|
|
widowed woman
|
|
secret agent
|
|
chase scene
|
|
paris
|
|
```
|
|
|
|
---
|
|
|
|
## 進階搜尋測試
|
|
|
|
### 4. 短語搜尋
|
|
```bash
|
|
curl -X POST http://localhost:3002/api/v1/search \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"query": "fun plot twists", "limit": 3}'
|
|
```
|
|
|
|
### 5. 情感/描述詞
|
|
```
|
|
charming performances
|
|
hilarious
|
|
suspenseful
|
|
dramatic
|
|
```
|
|
|
|
### 6. 動作場景
|
|
```
|
|
running
|
|
chase
|
|
fighting
|
|
dancing
|
|
```
|
|
|
|
---
|
|
|
|
## 整合範例
|
|
|
|
### n8n Workflow
|
|
```
|
|
搜尋詞: "charade"
|
|
→ 取得 chunk 的 start_time, end_time
|
|
→ 組裝成影片 URL
|
|
→ 回傳給用戶
|
|
```
|
|
|
|
### PHP 範例
|
|
```php
|
|
$searchTerms = ['charade', 'woody', 'audrey', 'classic'];
|
|
|
|
// 搜尋每個詞
|
|
foreach ($searchTerms as $term) {
|
|
$ch = curl_init('http://localhost:3002/api/v1/search');
|
|
curl_setopt($ch, CURLOPT_POST, true);
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
|
|
'query' => $term,
|
|
'limit' => 5
|
|
]));
|
|
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
|
|
$response = curl_exec($ch);
|
|
$data = json_decode($response, true);
|
|
|
|
// 處理結果
|
|
foreach ($data['results'] as $result) {
|
|
echo "{$result['text']} (score: {$result['score']})\n";
|
|
}
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## 預期回傳格式
|
|
|
|
```json
|
|
{
|
|
"results": [
|
|
{
|
|
"uuid": "a1b10138a6bbb0cd",
|
|
"chunk_id": "sentence_0006",
|
|
"chunk_type": "sentence",
|
|
"start_time": 48.8,
|
|
"end_time": 55.44,
|
|
"text": "fun plot twists, Woody Dialog and charming performances...",
|
|
"score": 0.526
|
|
}
|
|
],
|
|
"query": "charade"
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## 測試檢查清單
|
|
|
|
- [ ] 基本關鍵字搜尋
|
|
- [ ] n8n 整合格式
|
|
- [ ] 影片時戳取得
|
|
- [ ] 多筆結果排序
|
|
- [ ] 不同 chunk_type 搜尋
|