Next-generation full-text search library for Browser and Node.js
Next-generation full-text search library for Browser and Node.js
Getting instant help by the DeepWiki AI assistant:
<p></p>
Basic Start • API Reference • Encoder • Document Search • Persistent Indexes • Using Worker • Tag Search • Highlighting • Resolver • Changelog
FlexSearch has been helping developers around the world build powerful, efficient search functionalities for years. Maintaining and improving the library requires significant time and resources. If you’ve found this project valuable and you're interested in supporting the project, please consider donating. Thanks a lot for your continued support!
FlexSearch performs queries up to 1,000,000 times faster compared to other libraries by also providing powerful search capabilities like multi-field search (document search), phonetic transformations, partial matching, tag-search, result highlighting or suggestions.
Bigger workloads are scalable through workers to perform any updates or queries to the index in parallel through dedicated balanced threads.
The latest generation v0.8 introduce Persistent Indexes, well optimized for scaling of large datasets and running in parallel. All available features was natively ported right into the database engine of your choice.
FlexSearch was nominated by the GitNation for the "Best Technology of the Year".
Supported Platforms:
Supported Database:
Supported Charsets:
Common Code Examples:
Demos:
Latest Benchmark Results| Library | Memory | Query: Single | Query: Multi | Query: Large | Query: Not Found |
|---|---|---|---|---|---|
| flexsearch | 16 | 50955718 | 11912730 | 13981110 | 51706499 |
| jsii | 2188 | 13847 | 949559 | 1635959 | 3730307 |
| wade | 980 | 60473 | 443214 | 419152 | 1239372 |
| js-search | 237 | 22982 | 383775 | 426609 | 994803 |
| minisearch | 4777 | 30589 | 191657 | 5849 | 304233 |
| orama | 5355 | 29445 | 170231 | 4454 | 225491 |
| elasticlunr | 3073 | 14326 | 48558 | 101206 | 95840 |
| lunr | 2443 | 11527 | 51476 | 88858 | 103386 |
| ufuzzy | 13754 | 2799 | 7788 | 58544 | 9557 |
| bm25 | 33963 | 3903 | 4777 | 12657 | 12471 |
| fuzzysearch | 300147 | 148 | 229 | 455 | 276 |
| fuse | 247107 | 422 | 321 | 337 | 329 |
Run Comparison: Performance Benchmark "Gulliver's Travels"
Extern Projects & Plugins:
[!TIP] Understanding those 3 elementary things about FlexSearch will improve your results significantly: Tokenizer, Encoder and Suggestions
npm install flexsearchThe dist folder is located in: node_modules/flexsearch/dist/
Download BuildsIt is not recommended to use the
/src/folder of this repository as it requires some kind of conditional compilation to resolve the build flags. The/dist/folder contains every version you might need including unminified ES6 modules. When none of the/dist/folder versions works for you please open an issue. Alternatively you can read more about Custom Builds.
| Build | File | CDN |
| flexsearch.bundle.min.js | Download | https://cdn |
Stemming with English preset
Tagging behavior when there are non-existent tags
IndexedDB adapter fails in Web Workers because distributed bundle resolves IndexedDB from `window.indexedDB`
Improvements to import, export and serialize
Using tags causes different (and poor) search results
`sqlite3` dependency introduces high-severity security vulnerability (GHSA-8qq5-rm4j-mr97)
Add docs for custom persistence storages
Using limit with merge while using document search can give more results than limit.
Document index + worker in NextJS
highlighted results are misleading