nextapps-de/flexsearch
35.8
Weak · 1 October 2026
42.2k
lines of production code
JavaScript
primary language
2
measurements over time
What this system is
This system is a high-performance search library that provides flexible indexing and querying capabilities for both browser and Node.js environments. It supports persistent storage across a wide range of backends, including IndexedDB, Redis, SQLite, PostgreSQL, MongoDB, and ClickHouse, while offering advanced features like complex boolean query resolution, fuzzy matching, and customizable result highlighting. The library also includes language-specific tokenization for German, English, and French, along with asynchronous worker support to ensure non-blocking performance during heavy indexing and search operations.
How it got here
2018–2021 — v0.8 release and async worker support
14 changes.
This period centered on the major v0.8 release, introducing persistent index support across multiple database engines and a new resolver system for complex query composition. Significant architectural improvements included the addition of asynchronous operation handling and dedicated worker thread support for both Node.js and browser environments to prevent main-thread blocking. The release also expanded language-specific search capabilities for German, English, and French, alongside a modernized build system and comprehensive test coverage.
2024–2025 — multi-backend storage and encoding overhaul
21 changes.
This period focused on expanding FlexSearch's persistence capabilities by introducing a unified storage interface and implementing backends for SQLite, PostgreSQL, ClickHouse, MongoDB, Redis, and IndexedDB. Concurrently, the core indexing engine was refactored with a new tolerant tokenizer and enhanced boolean query resolution, while charset encoding profiles were expanded to support diverse character sets and normalization strategies.
Features
Add Node.js ESM examples for Worker, Document, and Resolver features
This update adds a comprehensive set of new examples for the Node.js ESM build, demonstrating usage of the Worker, Document, and Resolver APIs. The new examples cover basic operations as well as advanced patterns including persistent storage via SQLite, export/import of index data, and external configuration loading for workers. Specific additions include basic-worker, basic-worker-extern-config, basic-worker-export-import, document, document-worker, document-worker-extern-config, document-worker-export-import, document-resolver, basic-resolver, basic-suggestion, basic-persistent, document-persistent, basic-export-import, document-export-import, and language-pack.
example/nodejs-esm · high confidence
Add dedicated worker thread handlers for Node.js and browser environments
The library now includes specific entry points for running search operations in background worker threads. New files \src/worker/handler.js\, \src/worker/worker.js\, \src/worker/node.js\, and \src/worker/node.mjs\ implement the message-passing logic required to offload indexing and search tasks from the main thread, supporting both CommonJS and ESM module systems in Node.js as well as standard browser workers.
src/worker · high confidence
Added ClickHouse, MongoDB, and PostgreSQL storage backends
The library now supports persistent storage via ClickHouse, MongoDB, and PostgreSQL. Users can configure these databases to store search indexes, enabling scalable and durable search capabilities beyond in-memory storage. Each backend implements the standard storage interface, handling schema creation, indexing, and data persistence automatically upon initialization.
dist/db/clickhouse · high confidence
Added German, English, and French language presets
New language configuration files have been added for German (de.js), English (en.js), and French (fr.js). These presets provide specific stopword filters, stemmers, and character mappings to improve text encoding and search relevance for these languages.
src/lang · high confidence
Added Gulliver's Travels demo data
The demo application now includes a new data source for 'Gulliver's Travels', providing text queries and the full text of the book (including the Letter to Sympson and Part I) for testing search and retrieval features.
demo/data · high confidence
Added Node.js worker thread support for FlexSearch
The distribution now includes dedicated worker scripts (\node.js\ and \node.mjs\) that enable running FlexSearch index operations in Node.js worker threads. These standalone files handle asynchronous tasks such as initialization, search, import, and export, allowing users to offload heavy indexing and querying work to background threads to prevent blocking the main event loop.
dist/node · high confidence
Added PostgreSQL storage backend for FlexSearch
The distribution now includes a new PostgreSQL database adapter (\dist/module/db/postgres/index.js\ and its debug counterpart), allowing users to store and query FlexSearch indexes in a PostgreSQL database. This implementation handles schema creation, table management for mapping, context, tags, and configuration, and supports custom connection configurations such as schema, host, port, and credentials.
dist/module-debug/db/postgres, dist/module/db/postgres · high confidence
Added SQLite storage backend for FlexSearch
The distribution now includes a new SQLite-based storage implementation (\dist/module/db/sqlite\ and \dist/module-debug/db/sqlite\). This allows users to persist search indexes to disk using the \sqlite3\ library, supporting both in-memory and file-based databases. The implementation handles schema creation for map, context, tag, registry, and configuration tables, and maps various ID types (text, int, bigint) to appropriate SQLite column types.
dist/db/sqlite, dist/module-debug/db/sqlite, dist/module/db/sqlite · high confidence
Added browser-module examples for FlexSearch v0.8.2
This change introduces a new set of browser-based examples under the \example/browser-module\ directory, demonstrating how to use FlexSearch v0.8.2 with ES modules. These examples cover basic indexing, document indexing, persistent storage via IndexedDB, Web Workers (including external configuration), query resolvers, suggestions, and language packs, providing modern module-based usage patterns alongside the existing legacy script examples.
example/browser-module · high confidence
Added charset normalization and encoding options modules
New modules have been added to the charset directory to support character encoding and normalization. The \polyfill.js\ file introduces a comprehensive mapping of accented, special, and non-Latin characters (including CJK, Greek, and Cyrillic) to their ASCII or standard equivalents. Additionally, \cjk.js\, \exact.js\, and \normalize.js\ provide specific configuration options for encoding behavior, such as splitting, normalization, and deduplication, allowing users to fine-tune how text is processed.
src/charset · high confidence
Added database storage interface stub
A new minified interface file for the database module has been added, defining a StorageInterface class with stub implementations for standard storage operations such as mount, open, close, destroy, commit, get, enrich, has, remove, clear, search, and info.
dist/module-min/db · high confidence
Added dedicated worker handlers for browser and Node.js environments
The library now includes specific worker entry points for both browser and Node.js contexts. The new \dist/module/worker/handler.js\ and \dist/module/worker/worker.js\ files provide a browser-compatible implementation that initializes the search index and routes tasks (such as search, import, and export) via \postMessage\. Additionally, \dist/module/worker/node.js\ offers a standalone CommonJS worker for Node.js using \worker\_threads\, which handles index initialization from configuration files and manages asynchronous task execution. These changes enable users to offload search operations to background workers in both environments, improving main-thread performance.
dist/module-debug/worker, dist/module-min/worker, dist/module/worker · high confidence
Added language-specific encoding configurations for German, English, and French
The distribution now includes dedicated encoder modules for German (de.js), English (en.js), and French (fr.js). Each module provides language-specific stopword filters, stemmer rules, and text preparation logic (such as handling special characters and contractions) to improve search indexing accuracy for these languages.
dist/module/lang · high confidence
Added language-specific search handlers for German, English, and French
The distribution now includes dedicated language modules for German (de.min.js), English (en.min.js), and French (fr.min.js). These files provide language-aware tokenization, including character normalization (e.g., handling umlauts in German, apostrophes in English/French), stop-word filtering, and stemming rules, which are exposed to the FlexSearch library to improve search accuracy for these specific languages.
dist/lang · high confidence
Expanded Node.js CommonJS examples for advanced indexing features
The \example/nodejs-commonjs\ directory has been updated with a comprehensive suite of new demonstration scripts covering previously unrepresented capabilities: persistent storage via SQLite, asynchronous worker-based indexing, document-level indexing with multi-field and tag support, export/import workflows for both standard and worker indexes, and complex query resolution. These additions provide concrete usage patterns for features such as \Document\ indexing, \Worker\ integration, external configuration loading, and data persistence, complementing the existing basic, suggestion, and resolver examples.
example/nodejs-commonjs · high confidence
IndexedDB storage backend implementation
The library now includes a built-in IndexedDB storage backend, available in both the standard and debug module distributions. This addition allows users to persist search indexes directly in the browser's IndexedDB, enabling large-scale indexing and data retention across sessions without relying on external storage solutions. The implementation handles database initialization, object store creation, and transaction management for map, context, tag, registry, and configuration fields.
dist/module-debug/db/indexeddb, dist/module/db/indexeddb, dist/module-debug/db/mongodb, dist/module/db/mongodb, dist/module-debug/db/redis, dist/module/db/redis · high confidence
Initial IndexedDB storage backend implementation
Added a new IndexedDB-based storage backend for the library, enabling persistent data storage in browser environments. The implementation includes core database operations such as opening connections, managing object stores for fields like map, context, tag, registry, and config, and handling transactions for read and write operations. This provides an alternative to in-memory storage for users requiring data persistence across sessions.
dist/db/indexeddb · high confidence
Initial release of Redis storage backend for FlexSearch
This change introduces a new Redis-based storage driver for the FlexSearch library, allowing users to persist and query search indexes using a Redis database. The implementation includes connection management (open/close/destroy), key sanitization, and support for context-aware searches, tag-based lookups, and result enrichment. It also provides methods to clear or destroy indexed data, handling specific key patterns for maps, contexts, tags, and references.
dist/db/redis · high confidence
Major v0.8 release with persistent indexes, resolver, and result highlighting
This update introduces version 0.8, bringing significant architectural and feature changes. Persistent indexes are now supported for IndexedDB, Redis, SQLite, Postgres, MongoDB, and Clickhouse. A new Resolver system allows for complex query composition (and, or, xor, not, limit, offset, boost, resolve). Result highlighting has been extended with boundary, ellipsis, and alignment support. The default encoder has switched to a multi-language charset normalization, with legacy charset presets renamed (e.g., LatinExact to Exact). TypeScript typings have been improved, and the \index.clear()\ method on persistent indexes now executes immediately and returns a Promise instead of stacking to the task queue.
(repo-wide) · high confidence
New ClickHouse storage backend for FlexSearch
Added a new ClickHouse-based storage implementation for FlexSearch, available in both the standard module and the debug build. This backend allows users to persist search indexes in a ClickHouse database, automatically creating the necessary database and tables (map, ctx, tag, reg, cfg) upon initialization. It supports configurable connection parameters (host, port, database) and maps JavaScript types to ClickHouse data types (e.g., String, Int32, UInt64), enabling scalable, server-side search indexing.
dist/module-debug/db/clickhouse, dist/module/db/clickhouse · high confidence
New Latin charset encoding profiles added
Added new encoding configuration files for the Latin charset, including 'soundex', 'balance', 'advanced', and 'extra' profiles in both the standard and debug module distributions. These profiles define specific character mappings, matchers, and replacers to customize how Latin text is encoded, with the 'soundex' profile implementing a phonetic encoding algorithm and the 'extra' profile combining soundex mapping with additional character compression rules.
dist/module-debug/charset/latin, dist/module/charset/latin · high confidence
New asynchronous operation handling with runtime balancing
The library now exposes asynchronous versions of core methods (add, append, search, update, remove, and searchCache) on both Index and Document instances. These new methods (e.g., addAsync) automatically manage event-loop timing to prevent blocking the main thread during heavy operations, ensuring smoother performance in synchronous-heavy environments.
src · high confidence
New autocomplete demo with result highlighting and keyboard navigation
The demo directory now includes a new autocomplete example (demo/autocomplete.html) that showcases the library's Document Index capabilities. This demo implements instant search, auto-complete suggestions, and result highlighting (using the 'highlight' option in searchCache) on a movie title dataset. It also demonstrates keyboard navigation for selecting suggestions and uses a forward tokenizer for efficient prefix matching.
demo · high confidence
New configurable build system with custom bundle profiles
The task module now includes a new build infrastructure (babel.js, build.js, and associated Babel configuration files) that allows generating customized library bundles. Users can now build specific variants such as debug, minified, or language-specific packages by toggling compile-time flags like SUPPORT\_WORKER, SUPPORT\_CHARSET, and SUPPORT\_HIGHLIGHTING, replacing the previous static build process with a flexible, argument-driven compilation pipeline.
task · high confidence
New debug module distribution with async task balancing and chunked serialization
The library now includes a \dist/module-debug\ directory containing the full source code for debugging and development purposes. This distribution introduces a runtime balancer for async tasks to prevent blocking the main thread during high-load operations, and implements chunked export/import logic to handle large datasets more efficiently by processing data in manageable segments rather than all at once.
dist/module · high confidence
New external database storage backends for FlexSearch
The library now supports persisting search indexes to external databases, including ClickHouse, MongoDB, PostgreSQL, Redis, and SQLite, in addition to the existing IndexedDB support. This change introduces a unified \StorageInterface\ and specific implementations for each backend, allowing users to offload storage to scalable or server-side databases rather than relying solely on browser-based storage.
src/db · high confidence
Behavioural changes
Added StorageInterface definition for database module
The database module now includes a formal \StorageInterface\ definition (in both \dist/module/db\ and \dist/module-debug/db\) that specifies the contract for storage operations. This interface exposes methods for lifecycle management (\mount\, \open\, \close\, \destroy\), data manipulation (\get\, \enrich\, \has\, \remove\, \clear\, \commit\), and querying (\search\, \info\), providing a standardized API for interacting with the underlying storage system.
dist/module-debug/db, dist/module/db · high confidence
Added charset encoder configuration modules
The distribution now includes dedicated configuration modules for character encoding behavior in both the standard and debug builds. These new files define specific encoder options: \cjk.js\ sets an empty split strategy for CJK characters, \exact.js\ disables normalization, numeric conversion, and deduplication, \normalize.js\ provides default options, and \polyfill.js\ exports a mapping table for normalizing accented and special characters to their ASCII equivalents.
dist/module-debug/charset, dist/module/charset · high confidence
Enhanced result highlighting with configurable boundaries and ellipsis
The document search module now supports advanced result highlighting, allowing users to configure the visual presentation of matched terms via a template string and options for boundary control and ellipsis insertion. This change introduces new files (\src/document/highlight.js\, \src/document/add.js\, \src/document/search.js\) that implement the highlighting logic, integrate it into the search flow, and handle document indexing updates to support these features. Users can now customize how search matches are wrapped and truncated in the returned results, improving readability and context preservation.
src/document · high confidence
FlexSearch.js updated to v0.8.214 with new bundle formats
The distribution files in the dist folder have been updated to FlexSearch.js v0.8.214. This release introduces new bundle variants, including debug and module-specific builds (e.g., flexsearch.bundle.debug.js, flexsearch.bundle.module.debug.js), alongside the standard minified bundle. The update includes internal refactoring for the encoder, document resolver, and worker support, as well as fixes for result highlighting and export/import functionality.
dist · high confidence
Refactored search resolver logic for boolean operations
The search resolver's handling of boolean operations (AND, OR, NOT, XOR) and default result aggregation has been refactored. The \handler.js\ module now centralizes the processing of query arguments, managing asynchronous execution and result collection before passing them to specific operation modules. New dedicated files (\and.js\, \or.js\, \not.js\, \xor.js\, \default.js\) implement the logic for combining search results, including intersection, union, exclusion, and exclusive-or operations, as well as default result enrichment and pagination.
dist/module-debug/resolve, dist/module/resolve · high confidence
Reimplemented core indexing and search logic with new tokenizer and deduplication
The core indexing and search behavior in \src/index\ has been rewritten to support a new 'tolerant' tokenizer that generates swapped and missing-letter variants for improved fuzzy matching, alongside a restructured \add\ and \remove\ implementation that explicitly manages term deduplication via context chains. This change also introduces a new \search\ flow that handles multi-term queries with moving context windows and integrates persistent database interactions, fundamentally altering how documents are indexed, updated, and retrieved compared to the previous version.
src/index · high confidence
Updated search index implementation with new tokenization and context handling
The core search index files (add, remove, search) have been updated to version 0.8.2, introducing a new 'tolerant' tokenizer that generates partial tokens for improved matching, and enhancing context-aware search by tracking term relationships in the index. The search logic now supports enriched results and resolver integration, while the add/remove operations have been refactored to handle document updates and deletions more efficiently with better deduplication.
dist/module-debug/index, dist/module/index · high confidence
Test coverage
Added comprehensive test suite and coverage configuration
Added a new test suite in the \test/\ directory to verify FlexSearch functionality, including configuration for code coverage via \.c8rc.json\ (setting 80% thresholds for branches, functions, lines, and statements). The tests cover core \Index\ operations (add, append, update, remove, clear), \Document\ multi-field search, tag-based filtering, context chain handling, result highlighting, and various character encodings (CJK, Cyrillic, Arabic, Greek). It also includes regression tests for specific GitHub issues and validates persistent storage adapters for Clickhouse, Redis, MongoDB, SQLite, and Postgres.
test · high confidence
Dependencies
Update to FlexSearch v0.8.215 with modern build and database support
The library has been upgraded to version 0.8.215, introducing a modernized build system that supports CommonJS and ES Module exports via the new \exports\ field in package.json. This release adds official database integrations for ClickHouse, MongoDB, PostgreSQL, Redis, and SQLite, allowing users to persist search indexes directly to these storage engines. The development environment has also been updated to use Mocha v11, Chai v5, and Rollup v4, ensuring compatibility with current Node.js standards.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 36 → 36 (+0.3)
- Rubric changed (rubric-2026.09.12 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 25 → 25 (+0.0)
- Architecture 37 → 44 (+6.5)
- Maturity 63 → 63 (+0.0)
- Readiness 41 → 31 (-10.1)
- Security 75 → 75 (+0.0)
- Performance 100 (new)
Resolved (37)
- Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (no pnpm-resolved versions to grade)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- _push_index (cyclomatic 29) (src/index/add.js)
- add (cyclomatic 49) (src/index/add.js)
- add (cyclomatic 55) (src/document/add.js)
- assign (cyclomatic 34) (src/encoder.js)
- commit (cognitive 71) (src/db/mongodb/index.js)
- commit (cognitive 74) (src/db/clickhouse/index.js)
- commit (cognitive 94) (src/db/redis/index.js)
- commit (cognitive 97) (src/db/postgres/index.js)
- commit (cyclomatic 36) (src/db/mongodb/index.js)
- commit (cyclomatic 37) (src/db/clickhouse/index.js)
- commit (cyclomatic 42) (src/db/postgres/index.js)
- commit (cyclomatic 42) (src/db/redis/index.js)
- commit (cyclomatic 45) (src/db/indexeddb/index.js)
- commit (cyclomatic 45) (src/db/sqlite/index.js)
- encode (cyclomatic 72) (src/encoder.js)
- enrich (cognitive 19) (src/db/sqlite/index.js)
- get (cyclomatic 16) (src/db/mongodb/index.js)
- …and 17 more
New (40)
- Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (the committed lockfile resolved no direct production dependency)
- add.Document.add (cyclomatic 55) (src/document/add.js)
- add.Index._push_index (cyclomatic 29) (src/index/add.js)
- add.Index.add (cyclomatic 49) (src/index/add.js)
- document.Document.remove (cognitive 36) (src/document.js)
- encoder.Encoder.assign (cyclomatic 34) (src/encoder.js)
- encoder.Encoder.encode (cyclomatic 72) (src/encoder.js)
- handler.Resolver.handler (cyclomatic 72) (src/resolve/handler.js)
- index.ClickhouseDB.commit (cognitive 74) (src/db/clickhouse/index.js)
- index.ClickhouseDB.commit (cyclomatic 37) (src/db/clickhouse/index.js)
- index.ClickhouseDB.search (cyclomatic 31) (src/db/clickhouse/index.js)
- index.IdxDB.commit (cognitive 45) (src/db/indexeddb/index.js)
- index.IdxDB.commit (cyclomatic 45) (src/db/indexeddb/index.js)
- index.IdxDB.get (cyclomatic 21) (src/db/indexeddb/index.js)
- index.MongoDB.commit (cognitive 71) (src/db/mongodb/index.js)
- index.MongoDB.commit (cyclomatic 36) (src/db/mongodb/index.js)
- index.MongoDB.get (cyclomatic 16) (src/db/mongodb/index.js)
- index.MongoDB.search (cognitive 56) (src/db/mongodb/index.js)
- index.MongoDB.search (cyclomatic 31) (src/db/mongodb/index.js)
- index.PostgresDB.commit (cognitive 97) (src/db/postgres/index.js)
- …and 20 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
nextapps-de/flexsearch was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit f7ed963096a0792da7b2fd63bb7114b3fbac55ed — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.