#!/bin/bash # Visual Search 基础功能测试 # 使用现有的 Smart Search API set -e API_URL="http://localhost:3002" API_KEY="muser_demo_key_32chars_abcdef1234567890" echo "=========================================" echo " Visual Search 基础功能测试" echo "=========================================" echo -e "\n[测试 1] 语义搜索: people talking" curl -s -X POST "$API_URL/api/v1/search/smart" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $API_KEY" \ -d '{ "query": "people talking", "limit": 5 }' | jq '{total: .results | length, first_result: .results[0].file_uuid}' echo -e "\n[测试 2] 场景搜索: outdoor" curl -s -X POST "$API_URL/api/v1/search/smart" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $API_KEY" \ -d '{ "query": "outdoor", "limit": 5 }' | jq '{total: .results | length, first_result: .results[0].file_uuid}' echo -e "\n[测试 3] VLM 描述搜索: sunset" curl -s -X POST "$API_URL/api/v1/search/smart" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $API_KEY" \ -d '{ "query": "sunset", "limit": 5 }' | jq '{total: .results | length, first_result: .results[0].file_uuid}' echo -e "\n[测试 4] 人物相关: person" curl -s -X POST "$API_URL/api/v1/search/smart" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $API_KEY" \ -d '{ "query": "person", "limit": 5 }' | jq '{total: .results | length, first_result: .results[0].file_uuid}' echo -e "\n[测试 5] 详细结果示例" curl -s -X POST "$API_URL/api/v1/search/smart" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $API_KEY" \ -d '{ "query": "meeting", "limit": 1 }' | jq '.results[0] | {file_uuid, file_name, start_time, end_time, summary, similarity}' echo -e "\n=========================================" echo " 测试完成" echo "=========================================" echo -e "\n✅ 测试成功!" echo " - Smart Search API 正常工作" echo " - 可以进行语义和关键词搜索" echo " - 返回结果包含视频片段和时间信息"