Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
F

flexsearch

> 数据库
Open source

Next-generation full-text search library for Browser and Node.js

13.8K stars0 likes0 views
WebsiteGitHub

About

Next-generation full-text search library for Browser and Node.js

Getting instant help by the DeepWiki AI assistant:

<p></p>

Next-Generation full-text search library for Browser and Node.js

Basic Start  •  API Reference  •  Encoder  •  Document Search  •  Persistent Indexes  •  Using Worker  •  Tag Search  •  Highlighting  •  Resolver  •  Changelog

Please Support this Project

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 Sponsors


Antithesis Operations LLC

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:

  • Browser
  • Node.js

Supported Database:

  • InMemory (Default)
  • IndexedDB (Browser)
  • Redis
  • SQLite
  • Postgres
  • MongoDB
  • Clickhouse

Supported Charsets:

  • Latin
  • Chinese, Korean, Japanese (CJK)
  • Hindi
  • Arabic
  • Cyrillic
  • Greek and Coptic
  • Hebrew

Common Code Examples:

  • Node.js: Module (ESM)
  • Node.js: CommonJS
  • Browser: Module (ESM)
  • Browser: Legacy Script

Demos:

  • Auto-Complete

Benchmarks:

  • Performance Benchmark
  • Matching Benchmark
Latest Benchmark Results
The benchmark was measured in terms per seconds, higher values are better (except the test "Memory"). The memory value refers to the amount of memory which was additionally allocated during search.
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:

  • React: https://github.com/angeloashmore/react-use-flexsearch
  • Vue: https://github.com/Noction/vue-use-flexsearch
  • Gatsby: https://www.gatsbyjs.org/packages/gatsby-plugin-flexsearch/
  • Nikola: https://plugins.getnikola.com/v8/flexsearch_plugin/

Table of contents

[!TIP] Understanding those 3 elementary things about FlexSearch will improve your results significantly: Tokenizer, Encoder and Suggestions

  • Load Library (Node.js, ESM, Legacy Browser)
    • Non-Module Bundles (ES5 Legacy)
    • Module (ESM)
    • Node.js
  • Basic Usage and Variants
    • Index Options
    • Search Options
  • Common Code Examples (Browser, Node.js)
  • API Overview
  • Presets
  • Context Search
    • Context Options
  • Fast-Update Mode
  • Suggestions
  • Document Search (Multi-Field Search)
    • Document Index Options
    • Document Descriptor
    • Document Search Options
    • Multi-Tag Search
    • Result Highlighting
      • Highlighting Options
        • Boundary Options
        • Ellipsis Options
  • Phonetic Search (Fuzzy Search)
  • Tokenizer (Partial Search)
  • Charset Collection
  • Encoder
    • Encoder Options
    • Universal Charset Collection
    • Latin Charset Encoder Presets
    • Language Specific Preset
    • Custom Encoder
  • Async Non-Blocking Runtime Balancer
  • Worker Indexes
    • Worker Index Options
  • Resolver (Complex Queries)
    • Resolver Options
    • Boolean Operations (and, or, xor, not)
    • Boost
    • Limit / Offset
    • Resolve
  • Auto-Balanced Cache by Popularity/Last Query
  • Export / Import Indexes
    • Fast-Boot Serialization
  • Persistent Indexes
    • Persistent Index Options
    • IndexedDB (Browser)
    • Postgres
    • Redis
    • MongoDB
    • SQLite
    • Clickhouse
  • Custom Score Function
  • Custom Builds
  • Extended Keystores (In-Memory Index)
  • Best Practices
    • Page-Load / Fast-Boot
    • Prefer numeric typed IDs

Load Library (Node.js, ESM, Legacy Browser)

bash
npm install flexsearch

The dist folder is located in: node_modules/flexsearch/dist/

It 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.

Download Builds
Build File CDN
flexsearch.bundle.min.js Download https://cdn

Issues· 38 open

View all issuesOpen on GitHub
  • #535

    Stemming with English preset

    Updated Jul 10, 2026
  • #551

    Tagging behavior when there are non-existent tags

    Updated Jul 2, 2026
  • #546

    IndexedDB adapter fails in Web Workers because distributed bundle resolves IndexedDB from `window.indexedDB`

    Updated Jun 1, 2026
  • #538

    Improvements to import, export and serialize

    Updated May 29, 2026
  • #533

    Using tags causes different (and poor) search results

    bugUpdated May 29, 2026
  • #536

    `sqlite3` dependency introduces high-severity security vulnerability (GHSA-8qq5-rm4j-mr97)

    Updated May 29, 2026
  • #539

    Add docs for custom persistence storages

    Updated Mar 17, 2026
  • #532

    Using limit with merge while using document search can give more results than limit.

    Updated Jan 29, 2026
  • #522

    Document index + worker in NextJS

    Updated Dec 18, 2025
  • #514

    highlighted results are misleading

    Updated Nov 12, 2025

> Tags

JavaScriptelasticsearchfull-text-searchfulltext-searchfuzzy

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 2, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库