Files
momentry_core/scripts/test_search_modes_v2.sh
Warren 8f05a7c188 feat: update Python processors and add utility scripts
- Update ASR, face, OCR, pose processors
- Add release pre-flight check script
- Add synonym generation, chunk processing scripts
- Add face recognition, stamp search utilities
2026-04-30 15:07:49 +08:00

69 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
# Test all 4 search modes with 10 natural language queries (Round 2)
API_URL="http://localhost:3003"
API_KEY="muser_68600856036340bcafc01930eb4bd839_1774418104_97221b69"
LIMIT=10
QUERIES=(
"someone talking about money"
"car chase scene"
"romantic conversation"
"police investigation"
"happy ending moment"
"running away"
"secret message"
"crying emotional"
"dinner scene"
"airport goodbye"
)
MODES=("vector" "bm25" "hybrid" "smart")
echo "=== Search Mode Comparison Test (Round 2 - Online Synonyms) ==="
echo "Date: $(date)"
echo ""
for q in "${!QUERIES[@]}"; do
QUERY="${QUERIES[$q]}"
echo "========================================"
echo "Query $((q + 1)): \"$QUERY\""
echo "========================================"
for MODE in "${MODES[@]}"; do
echo ""
echo "--- Mode: $MODE ---"
case $MODE in
vector)
RESULT=$(curl -s -X POST "$API_URL/api/v1/n8n/search" \
-H "Content-Type: application/json" \
-H "x-api-key: $API_KEY" \
-d "{\"query\": \"$QUERY\", \"limit\": $LIMIT}")
;;
bm25)
RESULT=$(curl -s -X POST "$API_URL/api/v1/n8n/search/bm25" \
-H "Content-Type: application/json" \
-H "x-api-key: $API_KEY" \
-d "{\"query\": \"$QUERY\", \"limit\": $LIMIT}")
;;
hybrid)
RESULT=$(curl -s -X POST "$API_URL/api/v1/n8n/search/hybrid" \
-H "Content-Type: application/json" \
-H "x-api-key: $API_KEY" \
-d "{\"query\": \"$QUERY\", \"limit\": $LIMIT}")
;;
smart)
RESULT=$(curl -s -X POST "$API_URL/api/v1/n8n/search/smart" \
-H "Content-Type: application/json" \
-H "x-api-key: $API_KEY" \
-d "{\"query\": \"$QUERY\", \"limit\": $LIMIT}")
;;
esac
COUNT=$(echo "$RESULT" | jq -r '.count')
echo " Results: $COUNT"
echo "$RESULT" | jq -r '.hits[:3] | .[] | " \(.id): \(.text) [score: \(.score)]"'
done
echo ""
done