Search 100K docs in <1ms.
Zero servers._

Client-side full-text search engine optimized for static sites and serverless architectures. Fast, lightweight, and completely free.

Quick Start View on GitHub
0ms
Average Query Time
0K+
Docs Supported
0
API Calls
Cost Analysis

Why pay for search?

Stop paying thousands of dollars for managed search infrastructure.

Elasticsearch

$2K+/mo
  • Complex infrastructure to manage
  • High compute and memory costs
  • Overkill for most websites
  • Requires DevOps expertise

GhostSearch

$0/mo
  • Zero servers to manage
  • Runs entirely in browser
  • Sub-millisecond latency
  • BSL 1.1 License
Get Started

Algolia

$50K/yr
  • Expensive usage-based pricing
  • Vendor lock-in
  • Network latency overhead
  • Privacy concerns with data sharing
Architecture

How it works

01

Index

GhostSearch creates a highly compressed inverted index of your documents at build time.

02

Store

The compact index is shipped to the client as a static JSON or binary asset.

03

Query

Searches execute instantly in memory using Web Workers, blocking no UI thread.

Developer First

Integrates in minutes

npm install
initialize.js
search.js
npm install ghostsearch # Or use CDN <script src="https://cdn.jsdelivr.net/npm/ghostsearch"></script>
import { GhostSearch } from 'ghostsearch'; const data = [ { id: '1', title: 'React', category: 'UI Library' }, { id: '2', title: 'Vue', category: 'Framework' } ]; const search = new GhostSearch({ documents: data, searchFields: ['title', 'category'], idField: 'id' }); search.buildIndex();
Features

Everything you need

Fuzzy Matching

Handles typos and misspellings gracefully using optimized Levenshtein distance algorithms.

Faceted Search

Filter results by categories, tags, or custom attributes instantly.

Text Highlighting

Returns precise character offsets for matching terms to build beautiful UI highlights.

Web Workers

Offloads heavy indexing and searching to background threads to keep UI snappy.

Pre-computed Export

Generate indexes at build time and serve them as static JSON payloads for zero client-side indexing.

Pagination

Built-in cursor-based and offset pagination for handling large result sets efficiently.

FAQ

Common Questions

What is the best free alternative to Algolia? +

GhostSearch is the best free Algolia alternative for static sites and client-side applications. It runs entirely in the browser, meaning zero server costs, while still delivering sub-millisecond search performance on datasets up to 100K documents.

How does GhostSearch compare to Elasticsearch? +

Elasticsearch is a complex server-side distributed search engine designed for massive, dynamic datasets (billions of records). GhostSearch is a lightweight, client-side library meant for small to medium, relatively static datasets. If you're building a documentation site, a blog, or a catalog with under 100K items, GhostSearch is infinitely cheaper and easier to setup.

Won't downloading the index slow down my site? +

Not if configured correctly. GhostSearch indexes are heavily compressed. A 10K document dataset typically compresses to ~200KB. This payload can be fetched asynchronously or lazily loaded only when the user clicks the search bar.