MCPcopy
hub / github.com/nextapps-de/flexsearch

github.com/nextapps-de/flexsearch @0.8.2 sqlite

repository ↗ · DeepWiki ↗ · release 0.8.2 ↗
139 symbols 340 edges 129 files 30 documented · 22%
README

Getting instant help by the DeepWiki AI assistant: Ask DeepWiki.com

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

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!

Donate using Open Collective Donate using Github Sponsors Donate using Liberapay Donate using Patreon Donate using Bountysource Donate using PayPal

FlexSearch Sponsors

    <img src="https://github.com/nextapps-de/flexsearch/raw/0.8.2/doc/antithesis_logo.svg" width="200" alt="Donate using Open Collective">


    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:

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)

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.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.bundle.min.js
flexsearch.bundle.debug.js Download https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.bundle.debug.js
flexse

Extension points exported contracts — how you extend this code

IndexWorkerConfig (Interface)
(no doc)
index.d.ts

Core symbols most depended-on inside this repo

create_object
called by 23
src/common.js
create
called by 18
test/resolver.js
merge_option
called by 17
src/common.js
is_string
called by 12
src/common.js
tick
called by 11
src/async.js
toArray
called by 9
src/common.js
searchDocuments
called by 8
test/issues.js
register
called by 8
src/worker.js

Shape

Function 119
Class 16
Method 3
Interface 1

Languages

TypeScript100%

Modules by API surface

index.d.ts15 symbols
src/serialize.js13 symbols
src/common.js13 symbols
src/keystore.js9 symbols
test/issues.js8 symbols
src/worker.js5 symbols
src/db/mongodb/index.js5 symbols
test/types.ts4 symbols
src/db/sqlite/index.js4 symbols
src/db/indexeddb/index.js4 symbols
src/intersect.js3 symbols
src/index/search.js3 symbols

Dependencies from manifests, versioned

babel-cli6.26.0 · 1×
babel-plugin-conditional-compile0.0.5 · 1×
babel-plugin-minify-constant-folding0.5.0 · 1×
babel-plugin-minify-dead-code-elimination0.5.2 · 1×
babel-plugin-minify-flip-comparisons0.4.3 · 1×
babel-plugin-minify-guarded-expressions0.4.4 · 1×
babel-plugin-minify-infinity0.4.3 · 1×
babel-plugin-minify-mangle-names0.5.1 · 1×
babel-plugin-minify-replace0.5.0 · 1×
babel-plugin-minify-simplify0.5.1 · 1×
babel-plugin-minify-type-constructors0.4.3 · 1×
babel-plugin-transform-member-expression-literals6.9.4 · 1×

Datastores touched

(mongodb)Database · 1 repos

For agents

$ claude mcp add flexsearch \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact