Search

Managed full-text search for your application.

Overview

RaidFrame Search provides managed full-text search powered by Meilisearch. Add search to your app without running Elasticsearch or managing infrastructure.

rf add search
✓ Search provisioned
✓ SEARCH_URL injected into environment
✓ SEARCH_API_KEY injected
  Endpoint: https://search-abc123.raidframe.net

Index Documents

Node.js

import { MeiliSearch } from "meilisearch";

const search = new MeiliSearch({
  host: process.env.SEARCH_URL,
  apiKey: process.env.SEARCH_API_KEY,
});

const index = search.index("products");

await index.addDocuments([
  { id: 1, name: "MacBook Pro", category: "laptops", price: 2499 },
  { id: 2, name: "ThinkPad X1", category: "laptops", price: 1899 },
  { id: 3, name: "iPad Air", category: "tablets", price: 599 },
]);

Python

import meilisearch

client = meilisearch.Client(os.environ["SEARCH_URL"], os.environ["SEARCH_API_KEY"])
index = client.index("products")
index.add_documents([
    {"id": 1, "name": "MacBook Pro", "category": "laptops", "price": 2499},
])
const results = await index.search("macbook", {
  filter: "category = laptops AND price < 3000",
  sort: ["price:asc"],
  limit: 20,
  attributesToHighlight: ["name"],
});
{
  "hits": [
    {
      "id": 1,
      "name": "MacBook Pro",
      "_formatted": { "name": "<em>MacBook</em> Pro" },
      "category": "laptops",
      "price": 2499
    }
  ],
  "processingTimeMs": 2,
  "estimatedTotalHits": 1
}

Search is typo-tolerant, instant (sub-10ms), and supports filtering, sorting, faceting, and highlighting out of the box.

Configuration

search:
  products:
    type: search
    searchable_attributes: ["name", "description", "category"]
    filterable_attributes: ["category", "price", "in_stock"]
    sortable_attributes: ["price", "created_at"]
    ranking_rules: ["words", "typo", "proximity", "attribute", "sort", "exactness"]

Sync with Database

Keep your search index in sync with your database using the built-in sync worker:

search:
  products:
    sync:
      source: databases.main
      table: products
      columns: ["id", "name", "description", "category", "price"]
      trigger: on_change  # Real-time sync via database triggers

Changes to the products table are automatically reflected in the search index within milliseconds.

CLI Commands

# List indexes
rf search list

# View index info
rf search info products

# Search from CLI
rf search query products "macbook" --filter "price < 2000"

# Rebuild index
rf search rebuild products

# Clear index
rf search clear products

Pricing

PlanDocumentsIndex SizePrice
Starter10,000100 MBFree
Standard500,0002 GB$15/mo
Pro5,000,00020 GB$50/mo