#!/bin/bash # Visual Search 基础功能测试 # 使用现有的 SmartSearch 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/smart-search" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $API_KEY" \ -d '{ "query": "people talking", "limit": 5 }' | jq '.results | length' echo -e "\n[测试 2] 场景搜索: outdoor scene" curl -s -X POST "$API_URL/api/v1/smart-search" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $API_KEY" \ -d '{ "query": "outdoor scene", "limit": 5 }' | jq '.results | length' echo -e "\n[测试 3] VLM 描述搜索: sunset" curl -s -X POST "$API_URL/api/v1/smart-search" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $API_KEY" \ -d '{ "query": "sunset", "limit": 5 }' | jq '.results | length' echo -e "\n[测试 4] 人物搜索: person" curl -s -X POST "$API_URL/api/v1/smart-search" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $API_KEY" \ -d '{ "query": "person", "limit": 5 }' | jq '.results | length' echo -e "\n[测试 5] 详细结果示例" curl -s -X POST "$API_URL/api/v1/smart-search" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $API_KEY" \ -d '{ "query": "meeting room", "limit": 3 }' | jq '.results[0] | {file_uuid, start_time, end_time, summary}' echo -e "\n=========================================" echo " 测试完成" echo "========================================="