Skip to main content

Search

Hybrid search

Full-text & semantic search

Production-ready search infrastructure combining the best of keyword and semantic search. Full-text search with typo tolerance, semantic search with AI embeddings, and hybrid search combining both for optimal results. Features faceted filtering, highlighting, and search analytics.

Overview
Pricing
Usage
Docs
Examples
Index Documentindex.ts
typescript
import { sylphx } from '@sylphx/sdk'

await sylphx.search.index({
  namespace: 'products',
  externalId: 'prod_123',
  title: 'Wireless Headphones',
  content: 'Premium noise-canceling wireless headphones with 30h battery life.',
  category: 'electronics',
  tags: ['audio', 'wireless'],
})
Search (Hybrid)search.ts
typescript
const results = await sylphx.search.search({
  query: 'wireless headphones',
  searchType: 'hybrid', // 'keyword' | 'semantic' | 'hybrid'
  filters: { category: 'electronics' },
  highlight: true,
  limit: 10,
})

for (const result of results.results) {
  console.log(result.title, result.score)
  console.log(result.highlight)
}
Batch Indexbatch.ts
typescript
await sylphx.search.batchIndex({
  namespace: 'products',
  documents: [
    { externalId: 'prod_1', title: 'Item 1', content: '...' },
    { externalId: 'prod_2', title: 'Item 2', content: '...' },
    // Up to 100 documents per batch
  ],
})

Looking for more examples?

View on GitHub