#!/bin/bash

# Quick VectorLite API Test
# Simple test script for basic functionality

BASE_URL="http://localhost:3002"

echo "🚀 Quick VectorLite API Test"
echo "=============================="

# Check server health
echo "1. Health Check:"
curl -s "$BASE_URL/health" | jq .
echo

# List collections
echo "2. List Collections:"
curl -s "$BASE_URL/collections" | jq .
echo

# Create a collection
echo "3. Create Collection:"
curl -s -X POST "$BASE_URL/collections" \
  -H "Content-Type: application/json" \
  -d '{"name": "quick_test", "index_type": "hnsw"}' | jq .
echo

# Add some text
echo "4. Add Text:"
curl -s -X POST "$BASE_URL/collections/quick_test/text" \
  -H "Content-Type: application/json" \
  -d '{"text": "This is a quick test of the VectorLite API"}' | jq .
echo

# Search
echo "5. Search:"
curl -s -X POST "$BASE_URL/collections/quick_test/search/text" \
  -H "Content-Type: application/json" \
  -d '{"query": "test", "k": 1}' | jq .
echo

echo "✅ Quick test completed!"
