Skip to main content

Quick Start: Reference Guide

Quick reference for common commands, tips, and troubleshooting.


Quick Reference

Health & Monitoring

curl http://localhost:9200/health # Health check
curl http://localhost:9200/stats # Server statistics
curl http://localhost:9200/metrics # JSON metrics (minimal)

Collections

curl http://localhost:9200/collections # List all
curl -X POST http://localhost:9200/collections -d '{...}' # Create
curl http://localhost:9200/collections/products # Get details
curl -X DELETE http://localhost:9200/collections/products # Delete

Documents

# Add document
curl -X POST http://localhost:9200/collections/products/documents -d '{...}'

# Get document
curl http://localhost:9200/collections/products/documents/product1

# Update document
curl -X PUT http://localhost:9200/collections/products/documents/product1 -d '{...}'

# Delete document
curl -X DELETE http://localhost:9200/collections/products/documents/product1
# Basic search
curl "http://localhost:9200/collections/products/documents/search?q=laptop"

# With filters
curl "http://localhost:9200/collections/products/documents/search?q=laptop&filter_by=price:<1000"

# With sorting
curl "http://localhost:9200/collections/products/documents/search?q=*&sort_by=price:asc"

# With facets
curl "http://localhost:9200/collections/products/documents/search?q=*&facet_by=category"

# With highlighting
curl "http://localhost:9200/collections/products/documents/search?q=laptop&highlight=true"

Pro Tips

  1. Use POST for complex searches: Easier to format JSON in request body

    curl -X POST http://localhost:9200/collections/products/documents/search \
    -H "Content-Type: application/json" \
    -d '{"q": "laptop", "filter_by": "price:<1000", "sort_by": "price:asc"}'
  2. Enable typo tolerance: Set num_typos parameter

    curl "http://localhost:9200/collections/products/documents/search?q=laptpo&num_typos=2"
  3. Limit results: Use per_page parameter

    curl "http://localhost:9200/collections/products/documents/search?q=*&per_page=5"
  4. Pretty print JSON: Pipe through jq

    curl http://localhost:9200/stats | jq .

Troubleshooting

Problem: Server Not Responding

# Check if server is running
ps aux | grep hlquery

# Check logs
tail -f run/logs/hlquery.log

# Restart server
./hlquery restart

Problem: Search Returns No Results

# Verify documents exist
curl http://localhost:9200/collections/products/documents

# Check collection exists
curl http://localhost:9200/collections

# Update document counters
curl http://localhost:9200/update-counters

Problem: Slow Searches

# Check server stats
curl http://localhost:9200/stats

# Monitor real-time metrics
curl http://localhost:9200/metrics


Happy searching!

You're now ready to build amazing search experiences with hlquery.