Damp

Typesense Search

Open-source search engine

Open-source alternative to Algolia with blazing-fast search. Typo tolerance and powerful ranking out of the box.

Default Configuration

Image: typesense/typesense:27.1
Container: damp-typesense
Port: 8108:8108
Network: devnet
Volume: damp-typesense:/typesense-data

Environment Variables

VariableValueDescription
TYPESENSE_DATA_DIR/typesense-dataData directory
TYPESENSE_API_KEYxyzAdmin API key
TYPESENSE_ENABLE_CORStrueEnable CORS

Connection Information

From Docker Containers

http://damp-typesense:8108

From Host Machine

http://localhost:8108

API Key Required

All API requests require the API key: xyz

Laravel Scout Integration

Install Typesense Scout Driver

composer require typesense/typesense-php
composer require typesense/laravel-scout-typesense-driver

Configure .env

SCOUT_DRIVER=typesense
TYPESENSE_API_KEY=xyz
TYPESENSE_HOST=damp-typesense
TYPESENSE_PORT=8108
TYPESENSE_PROTOCOL=http

Usage

use Laravel\Scout\Searchable;

class Product extends Model
{
    use Searchable;
}

// Search
$products = Product::search('laptop')->get();

Direct API Usage

Create Collection

curl "http://localhost:8108/collections" \
  -X POST \
  -H "X-TYPESENSE-API-KEY: xyz" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "products",
    "fields": [
      {"name": "name", "type": "string"},
      {"name": "price", "type": "float"}
    ],
    "default_sorting_field": "price"
  }'

Index Documents

curl "http://localhost:8108/collections/products/documents" \
  -X POST \
  -H "X-TYPESENSE-API-KEY: xyz" \
  -H "Content-Type: application/json" \
  -d '{"name": "Laptop", "price": 999.99}'
curl "http://localhost:8108/collections/products/documents/search?q=laptop&query_by=name" \
  -H "X-TYPESENSE-API-KEY: xyz"

Features

  • Fast - Optimized for speed
  • 🔍 Typo Tolerance - Handles misspellings
  • 🎯 Geo Search - Location-based search
  • 📊 Faceting - Filter results by attributes
  • 🔒 Secured - Built-in API key authentication

Production Ready

Typesense is battle-tested and used by thousands of applications in production!