diagnose all Supermemory search modes
This commit is contained in:
@@ -67,23 +67,46 @@ if ! curl --fail --silent --show-error --max-time 15 \
|
||||
"$base_url/v3/search" >/tmp/search-v3.json; then
|
||||
fail 41 search-v3-request
|
||||
fi
|
||||
grep -q "$marker" /tmp/search-v3.json || fail 44 search-v3-no-hit
|
||||
v3_hit=false
|
||||
if grep -Eq '"total"[[:space:]]*:[[:space:]]*[1-9][0-9]*' /tmp/search-v3.json; then
|
||||
v3_hit=true
|
||||
fi
|
||||
|
||||
curl --fail --silent --show-error --max-time 15 \
|
||||
-H "$auth_header" \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data "{\"q\":\"$marker\",\"containerTag\":\"$container_tag\",\"searchMode\":\"documents\",\"limit\":5}" \
|
||||
"$base_url/v4/search" >/tmp/search-documents.json || fail 42 search-documents-request
|
||||
grep -q "$marker" /tmp/search-documents.json || fail 45 search-documents-no-hit
|
||||
grep -q 'poc-smoke' /tmp/search-documents.json || fail 46 search-documents-metadata-missing
|
||||
documents_hit=false
|
||||
documents_metadata=false
|
||||
if grep -Eq '"total"[[:space:]]*:[[:space:]]*[1-9][0-9]*' /tmp/search-documents.json && grep -q "$marker" /tmp/search-documents.json; then
|
||||
documents_hit=true
|
||||
fi
|
||||
if grep -q 'poc-smoke' /tmp/search-documents.json; then
|
||||
documents_metadata=true
|
||||
fi
|
||||
|
||||
curl --fail --silent --show-error --max-time 15 \
|
||||
-H "$auth_header" \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data "{\"q\":\"海棠计划下一步是什么?\",\"containerTag\":\"$container_tag\",\"searchMode\":\"hybrid\",\"limit\":5}" \
|
||||
"$base_url/v4/search" >/tmp/search-hybrid.json || fail 47 search-hybrid-request
|
||||
grep -q '核对原始报告' /tmp/search-hybrid.json || fail 48 search-hybrid-no-hit
|
||||
grep -q 'poc-smoke' /tmp/search-hybrid.json || fail 49 search-hybrid-metadata-missing
|
||||
hybrid_hit=false
|
||||
hybrid_metadata=false
|
||||
if grep -Eq '"total"[[:space:]]*:[[:space:]]*[1-9][0-9]*' /tmp/search-hybrid.json && grep -q '核对原始报告' /tmp/search-hybrid.json; then
|
||||
hybrid_hit=true
|
||||
fi
|
||||
if grep -q 'poc-smoke' /tmp/search-hybrid.json; then
|
||||
hybrid_metadata=true
|
||||
fi
|
||||
|
||||
printf '{"smoke":"search-diagnostic","v3":%s,"v4_documents":%s,"v4_documents_metadata":%s,"v4_hybrid":%s,"v4_hybrid_metadata":%s}\n' \
|
||||
"$v3_hit" "$documents_hit" "$documents_metadata" "$hybrid_hit" "$hybrid_metadata"
|
||||
[ "$v3_hit" = true ] || fail 44 search-v3-no-hit
|
||||
[ "$documents_hit" = true ] || fail 45 search-documents-no-hit
|
||||
[ "$documents_metadata" = true ] || fail 46 search-documents-metadata-missing
|
||||
[ "$hybrid_hit" = true ] || fail 48 search-hybrid-no-hit
|
||||
[ "$hybrid_metadata" = true ] || fail 49 search-hybrid-metadata-missing
|
||||
|
||||
curl --fail --silent --show-error --max-time 60 \
|
||||
-H "$auth_header" \
|
||||
|
||||
Reference in New Issue
Block a user