Skip to content
On this page

FlexSearch v0.7.0

The new version is finally available. FlexSearch v0.7.0 is a modern re-implementation and was newly developed from the ground up. The result is an improvement in every single aspect and covers tons of enhancements and improvements which was collected over the last 3 years.

This new version has a good compatibility with the old generation, but it might require some migrations steps in your code.

Read the documentation of new features and changes:
https://github.com/nextapps-de/flexsearch/blob/master/doc/0.7.0.md

Read the documentation of new language encoding features:
https://github.com/nextapps-de/flexsearch/blob/master/doc/0.7.0-lang.md

When it comes to raw search speed FlexSearch outperforms every single searching library out there and also provides flexible search capabilities like multi-field search, phonetic transformations or partial matching.

Depending on the used options it also provides the most memory-efficient index. FlexSearch introduce a new scoring algorithm called "contextual index" based on a pre-scored lexical dictionary architecture which actually performs queries up to 1,000,000 times faster compared to other libraries. FlexSearch also provides you a non-blocking asynchronous processing model as well as web workers to perform any updates or queries on the index in parallel through dedicated balanced threads.

Supported Platforms:

  • Browser
  • Node.js

Library Comparison "Gulliver's Travels":

Plugins (extern projects):

BuildFileCDN
flexsearch.bundle.jsDownloadhttps://rawcdn.githack.com/nextapps-de/flexsearch/0.7.31/dist/flexsearch.bundle.js
flexsearch.light.jsDownloadhttps://rawcdn.githack.com/nextapps-de/flexsearch/0.7.31/dist/flexsearch.light.js
flexsearch.compact.jsDownloadhttps://rawcdn.githack.com/nextapps-de/flexsearch/0.7.31/dist/flexsearch.compact.js
flexsearch.es5.js *Downloadhttps://rawcdn.githack.com/nextapps-de/flexsearch/0.7.31/dist/flexsearch.es5.js
ES6 ModulesDownloadThe /dist/module/ folder of this Github repository

* The bundle "flexsearch.es5.js" includes polyfills for EcmaScript 5 Support.

Get Latest (NPM)

cmd
npm install flexsearch

Get Latest Nightly (Do not use for production!)

Just exchange the version number from the URLs above with "master", e.g.: "/flexsearch/0.7.31/dist/" into "/flexsearch/master/dist".

Compare Web-Bundles

The Node.js package includes all features from flexsearch.bundle.js.

Featureflexsearch.bundle.jsflexsearch.compact.jsflexsearch.light.js
Presets-
Async Search-
Workers (Web + Node.js)--
Contextual Indexes
Index Documents (Field-Search)-
Document Store-
Partial Matching
Relevance Scoring
Auto-Balanced Cache by Popularity--
Tags--
Suggestions-
Phonetic Matching-
Customizable Charset/Language (Matcher, Encoder, Tokenizer, Stemmer, Filter, Split, RTL)
Export / Import Indexes--
File Size (gzip)6.8 kb5.3 kb2.9 kb

Performance Benchmark (Ranking)

Run Comparison: Performance Benchmark "Gulliver's Travels"

Operation per seconds, higher is better, except the test "Memory" on which lower is better.

RankLibraryMemoryQuery (Single Term)Query (Multi Term)Query (Long)Query (Dupes)Query (Not Found)
1FlexSearch177084129158685651158520171423202006
2JSii2765641581496129095098534109
3Wade424204717878016693225824213754
4JS Search1938221640341037795830167605
5Elasticlunr.js6465412757328652378613982
6BulkSearch1021306931413333326521825569
7MiniSearch24348440610945723998917624
8bm251571914297893668841823
9Lunr.js2219255271272266267
10FuzzySearch1573735338153243
11Fuse764190462123

Note

This feature is disabled by default because of its extended memory usage. Read hereto get more information about and how to enable.

FlexSearch introduce a new scoring mechanism called Contextual Search which was invented by Thomas Wilkerling, the author of this library. A Contextual Search incredibly boost up queries to a complete new level but also requires some additional memory (depending on depth). The basic idea of this concept is to limit relevance by its context instead of calculating relevance through the whole distance of its corresponding document. This way contextual search also improves the results of relevance-based queries on a large amount of text data.