FlexSearch logo

FlexSearch

Blazing-fast full-text search for browsers and Node.js

FlexSearch delivers ultra-fast, feature-rich full-text search in JavaScript, supporting multi-field queries, phonetic matching, tagging, highlighting, persistent indexes, and parallel workers across browsers and Node.js.

Overview

Overview

FlexSearch is a JavaScript full-text search engine designed for both browser and Node.js environments. It targets developers who need instant, high-performance search without relying on external services. The library offers multi-field document search, phonetic transformations, partial matching, tag-based queries, result highlighting, and suggestion generation, all within a single, lightweight package.

Scalable Deployment

Version 0.8 introduces persistent indexes that can be stored in a variety of back-ends—including IndexedDB, Redis, SQLite, PostgreSQL, MongoDB, and ClickHouse—allowing large data sets to be queried efficiently. Parallel workers distribute indexing and query workloads across threads or Web Workers, delivering benchmarked speeds up to a million times faster than many alternatives. The engine supports a broad set of character sets (Latin, CJK, Hindi, Arabic, Cyrillic, Greek, Hebrew), making it suitable for multilingual applications.

Integration

FlexSearch can be imported as an ES module or used with CommonJS, and it works seamlessly with modern frameworks. Community adapters provide ready-made hooks for React (react-use-flexsearch), Vue (vue-use-flexsearch), Gatsby (gatsby-plugin-flexsearch), and static site generators like Nikola. Because the core library is pure JavaScript, it can be bundled with bundlers such as Webpack, Rollup, or Vite, and it respects tree-shaking to keep bundle size minimal. The project is maintained by Antithesis Operations LLC and was nominated by GitNation for Best Technology of the Year.

Highlights

Up to 1,000,000× faster query performance
Persistent indexes with multi-database support
Parallel workers for scalable indexing and searching
Built-in phonetic, tag, and highlight capabilities

Pros

  • Exceptional speed demonstrated in benchmarks
  • Rich feature set reduces need for external services
  • Works both in browser and Node.js environments
  • Supports a wide range of character sets and databases

Considerations

  • Higher memory usage compared to minimal libraries
  • Complex configuration for advanced features may steepen learning curve
  • Persistent index adapters require external storage setup
  • Limited official UI components; integration relies on community plugins

Managed products teams compare with

When teams consider FlexSearch, these hosted platforms usually appear on the same shortlist.

Algolia logo

Algolia

Hosted search-as-a-service platform delivering real-time, full-text search for apps and websites

Amazon CloudSearch logo

Amazon CloudSearch

Managed search service to index and query text & structured data

Amazon Kendra logo

Amazon Kendra

AI-powered enterprise search service that indexes and searches across various content repositories with natural language queries

Looking for a hosted option? These are the services engineering teams benchmark against before choosing open source.

Fit guide

Great for

  • Web applications that need instant client-side search
  • Server-side services handling large document collections
  • Projects requiring multilingual search across CJK and RTL scripts
  • Teams that prefer a pure-JavaScript solution over external search engines

Not ideal when

  • Tiny scripts where bundle size must stay under a few kilobytes
  • Environments without Node.js or modern browser support
  • Use cases demanding out-of-the-box analytics or ranking algorithms
  • Projects that rely on a hosted SaaS search service for zero-maintenance operations

How teams use it

E‑commerce product catalog search

Customers receive instant, typo-tolerant results with highlighted matches, improving conversion rates.

Documentation site autocomplete

Developers find relevant pages instantly via multi-field and tag search, reducing support tickets.

Real‑time chat message filtering

Server processes millions of messages per second, using workers to keep latency low.

Multilingual news aggregator

Search across articles in Latin, CJK, Arabic, and Cyrillic scripts with phonetic matching.

Tech snapshot

JavaScript100%

Tags

search-engineopen-sourcesearch-in-textjavascript-libraryfulltext-searchfuzzysearch-algorithmsearchnodejssearchingfuzzy-searchelasticsearchwebweb-workerfull-text-searchsearching-algorithmsjavascript

Frequently asked questions

Does FlexSearch require a backend server?

No, it runs entirely in JavaScript and can operate in the browser or Node.js; backend storage is optional for persistent indexes.

Which databases are supported for persistent indexes?

InMemory (default), IndexedDB, Redis, SQLite, PostgreSQL, MongoDB, and ClickHouse.

How can I enable parallel processing?

FlexSearch provides a worker API that offloads indexing and query work to Web Workers (browser) or child processes (Node.js).

Is there TypeScript support?

Yes, the library ships with type definitions for seamless TypeScript integration.

Where can I find community integrations?

Official plugins exist for React, Vue, Gatsby, and Nikola, linked from the repository README.

Project at a glance

Stable
Stars
13,553
Watchers
13,553
Forks
520
LicenseApache-2.0
Repo age7 years old
Last commit4 months ago
Primary languageJavaScript

Last synced 4 hours ago