JavaScript full-text search libraries

Updated Nov 2026

JavaScript search libraries find matching records in a list of objects or documents without a search server. These libraries add search boxes to documentation sites, product catalogs, and offline apps that run entirely in the browser.

Popularity

Fuse.js has the most installs and the most GitHub stars.

LibraryMonthly downloadsStarsLast releaseLicense
Fuse.js
76.1M
20.5KJul 2026Apache-2.0
Lunr
37.2M
9.2KAug 2020MIT
MiniSearch
23.4M
6.2KSep 2025MIT
Orama
7.9M
10.6KDec 2025Apache-2.0
FlexSearch
5.3M
13.8KSep 2025Apache-2.0
Js Search
849.5K
2.2KMay 2023MIT
wink-bm25-text-search
277.9K
74Nov 2022MIT
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Features compared

LibraryAdd documents after indexingBundled TypeScript declarationsIndex serializationPrefix searchFuzzy matching
Fuse.jsBuilt-inBuilt-inBuilt-inBuilt-inBuilt-in
LunrUnsupportedUnsupportedBuilt-inBuilt-inBuilt-in
MiniSearchBuilt-inBuilt-inBuilt-inBuilt-inBuilt-in
OramaBuilt-inBuilt-inBuilt-inBuilt-inBuilt-in
FlexSearchBuilt-inBuilt-inBuilt-inBuilt-inBuilt-in
Js SearchBuilt-inUnsupportedUndocumentedBuilt-inUndocumented
wink-bm25-text-searchUnsupportedUnsupportedBuilt-inUndocumentedUndocumented
Built-inNot supportedNot documented

Libraries and code examples

Fuse.js is a fuzzy search library for small to medium datasets searched in the browser or on a server, with no dependencies. new Fuse takes an array of strings or objects and a keys list of fields to search. Calling search returns the matching items ranked by score. Matching uses the Bitap algorithm, an approximate string matcher, so queries with typos, misspellings, or partial words still find results. With useTokenSearch turned on, multi-word queries are ranked by relevance across all their words.

Downloads / mo
76.1M
Stars
20.5K
Last release
7.5.0
License
Apache-2.0

Strengths

  • Tolerates typos. Finds near matches when the query has typos, swapped letters, or missing characters.
  • Weights fields. Give title matches more weight than description matches.

Limitations

  • No index. Every search compares the query with every item. For larger datasets, FuseWorker splits the data across web workers, and an indexed library such as MiniSearch avoids the full scan.
  • Worker limits. FuseWorker can't take function-valued options, such as sortFn or getFn, because functions can't move to a worker.

Quickstart

From getting-started.md
$ npm install fuse.js
import Fuse from 'fuse.js'
const books = [
  { title: "Old Man's War", author: 'John Scalzi' },
  { title: 'The Lock Artist', author: 'Steve Hamilton' }
]
const fuse = new Fuse(books, {
  keys: ['title', 'author']
})
const results = fuse.search('jon')

Fuse.js examples

From open-source projects on GitHub

Lunr builds a full-text search index of JSON documents in the browser. A lunr call takes a function that declares the fields, such as title and body, and adds each document. Searching with idx.search returns matching document references, each with a relevance score and the terms that matched. Indexes serialize to JSON. A site can build its index at deploy time and load the result in the browser instead of indexing on every visit. Queries can boost terms, scope to single fields, or match with wildcards and edit distance. Language support covers fourteen languages.

Downloads / mo
37.2M
Stars
9.2K
Last release
2.3.9
License
MIT

Strengths

  • Prebuilt indexes. Build the index during the site build and serve the serialized index to the browser.
  • Field boosts. Boost a field at build time so its matches rank higher.

Limitations

  • Immutable indexes. After an index is built, documents can't be added, updated, or removed. Changing the documents means rebuilding the index.
  • Wildcards skip stemming. A search term with a wildcard isn't stemmed. The term matches only its literal form.

Quickstart

From getting_started.html
$ npm install lunr
var documents = [{
  "name": "Lunr",
  "text": "Like Solr, but much smaller, and not as bright."
}, {
  "name": "React",
  "text": "A JavaScript library for building user interfaces."
}, {
  "name": "Lodash",
  "text": "A modern JavaScript utility library delivering modularity, performance & extras."
}]
var idx = lunr(function () {
  this.ref('name')
  this.field('text')
  documents.forEach(function (doc) {
    this.add(doc)
  }, this)
})
idx.search("bright")

Lunr examples

From open-source projects on GitHub

MiniSearch keeps a full-text index in memory, in the browser or in Node.js, with no external dependencies. new MiniSearch lists the fields to index and the fields to return with results. After addAll loads the documents, search supports exact, prefix, and fuzzy matching with field boosts. A separate method, autoSuggest, completes partial queries for search as the user types. Unlike Lunr, MiniSearch lets documents be added and removed at any time.

Downloads / mo
23.4M
Stars
6.2K
Last release
7.2.0
License
MIT

Strengths

  • Prefix and fuzzy search. Supports prefix search, fuzzy search, ranking, and field boosts in one index.
  • Saves indexes as JSON. Serialize the index to JSON and reload it later with MiniSearch.loadJSON.

Limitations

  • Index in memory. The index is stored in process memory. The indexed data has to fit in that memory.
  • Custom stemming. Stemming and stop words come from a processTerm function the project supplies.

Quickstart

From README.md
$ npm install minisearch
import MiniSearch from 'minisearch'
const documents = [
  {
    id: 1,
    title: 'Moby Dick',
    text: 'Call me Ishmael. Some years ago...',
    category: 'fiction'
  },
  {
    id: 2,
    title: 'Zen and the Art of Motorcycle Maintenance',
    text: 'I can see by my watch...',
    category: 'fiction'
  },
  {
    id: 3,
    title: 'Neuromancer',
    text: 'The sky above the port was...',
    category: 'fiction'
  },
  {
    id: 4,
    title: 'Zen and the Art of Archery',
    text: 'At first sight it must seem...',
    category: 'non-fiction'
  },
]
let miniSearch = new MiniSearch({
  fields: ['title', 'text'], // fields to index for full-text search
  storeFields: ['title', 'category'] // fields to return with search results
})
miniSearch.addAll(documents)
let results = miniSearch.search('zen art motorcycle')

MiniSearch examples

From open-source projects on GitHub

Orama is a search engine that runs in the browser, on a server, or at the edge, with full-text, vector, and hybrid search in one database. create sets a schema of typed fields. Documents go in through insert. A search call with a term returns ranked hits. Setting mode to vector compares a query embedding with a vector field instead. Filters, facets, geosearch, typo tolerance, and stemming in thirty languages come built in.

Downloads / mo
7.9M
Stars
10.6K
Last release
3.1.18
License
Apache-2.0

Strengths

  • Field boosts. Boost a field so its matches rank higher.
  • Vector search built in. Vector, full-text, and hybrid queries use the same search function.

Limitations

  • Embeddings from outside. Vector queries need embeddings at insert and search time, from the project's own model or from the @orama/plugin-embeddings plugin.
  • Fixed vector size. Each vector field declares its dimension count when the database is created.

Quickstart

From index.mdx
$ npm install @orama/orama
import { create, search, insert } from "@orama/orama";
const db = create({
  schema: {
    name: "string",
    description: "string",
    price: "number",
    meta: {
      rating: "number",
    },
  },
});
insert(db, {
  name: "Wireless Headphones",
  description: "Experience immersive sound quality with these noise-cancelling wireless headphones.",
  price: 99.99,
  meta: {
    rating: 4.5,
  },
});
const searchResult = search(db, {
  term: "headphones",
});

Orama examples

From open-source projects on GitHub

FlexSearch builds full-text indexes for the browser and Node.js. Three index types cover different jobs: Index stores id and text pairs, Document indexes multi-field JSON documents, and Worker runs an index in a background thread. The tokenize option sets how partial words match. With forward, a query for flex finds flexsearch, while full indexes every substring at a much higher memory cost. Indexes stay in memory by default, and persistent indexes can store them in IndexedDB, Redis, SQLite, Postgres, MongoDB, or ClickHouse.

Downloads / mo
5.3M
Stars
13.8K
Last release
0.8.212
License
Apache-2.0

Strengths

  • Tokenizer controls matching. Choose a tokenizer so that typing flex or search finds flexsearch.
  • Worker threads. Run index updates and queries in parallel worker threads.

Limitations

  • Tokenizer sets memory. Broader partial matching multiplies index size. The README recommends the narrowest tokenizer that covers the queries users type.
  • Async workers. Every method on a Worker index returns a promise or takes a callback.

Quickstart

From index.js
$ npm install flexsearch
import { Index } from "flexsearch";
const index = new Index({
    tokenize: "forward"
});
const data = [
    'cats abcd efgh ijkl mnop qrst uvwx cute',
    'cats abcd efgh ijkl mnop qrst cute',
    'cats abcd efgh ijkl mnop cute',
    'cats abcd efgh ijkl cute',
    'cats abcd efgh cute',
    'cats abcd cute',
    'cats cute'
];
data.forEach((item, id) => {
    index.add(id, item);
});
const result = index.search("cute cat");

FlexSearch examples

From open-source projects on GitHub

Js Search indexes JavaScript and JSON objects for client-side search, with no third-party dependencies. new JsSearch.Search takes the field that identifies each document. Next, addIndex adds each field to search, including nested ones such as an author's name, and addDocuments loads the objects. Results rank by TF-IDF, a term-weighting score, unless the project switches to an unordered index. The index strategy sets what matches: word prefixes by default, exact words, or every substring. The library began as a lighter implementation of Lunr.

Downloads / mo
849.5K
Stars
2.2K
Last release
2.0.1
License
MIT

Strengths

  • Choice of index strategy. Index word prefixes by default, or switch to exact words or every substring.
  • No dependencies. It runs on ES5 and needs no third-party libraries.

Limitations

  • Stemming from another library. Stemming comes from a third-party stemmer, such as porter-stemmer, wrapped in a StemmingTokenizer.
  • Ranking costs time. Switching to UnorderedSearchIndex turns off TF-IDF ranking and returns results in no particular order.

Quickstart

From README.md
$ npm install js-search
import * as JsSearch from 'js-search';
var theGreatGatsby = {
  isbn: '9781597226769',
  title: 'The Great Gatsby',
  author: {
    name: 'F. Scott Fitzgerald'
  },
  tags: ['book', 'inspirational']
};
var theDaVinciCode = {
  isbn: '0307474275',
  title: 'The DaVinci Code',
  author: {
    name: 'Dan Brown'
  },
  tags: ['book', 'mystery']
};
var angelsAndDemons = {
  isbn: '074349346X',
  title: 'Angels & Demons',
  author: {
    name: 'Dan Brown',
  },
  tags: ['book', 'mystery']
};
var search = new JsSearch.Search('isbn');
search.addIndex('title');
search.addIndex(['author', 'name']);
search.addIndex('tags')
search.addDocuments([theGreatGatsby, theDaVinciCode, angelsAndDemons]);
search.search('The');    // [theGreatGatsby, theDaVinciCode]

Js Search examples

From open-source projects on GitHub

wink-bm25-text-search

wink-bm25-text-search builds an in-memory search index from JSON documents, in Node.js or the browser, ranked by a probabilistic relevance algorithm. defineConfig sets a weight for each field. Next, definePrepTasks sets the text preparation, such as tokenizing and stemming with wink-nlp, and addDoc adds documents. A call to consolidate finalizes the index before search runs. A negative field weight lowers a document's score when a query term appears in that field.

Downloads / mo
277.9K
Stars
74
Last release
3.1.2
License
MIT

Strengths

  • Field weights can be negative. Set a weight per field. A negative weight pushes down documents that match in that field.
  • Pluggable text preparation. Plug in wink-nlp for stemming, stop-word removal, and negation handling.

Limitations

  • Closed after consolidation. No documents can be added after consolidate. The README suggests exporting JSON before consolidating, then importing it to add more.
  • Setup order. defineConfig and definePrepTasks must run before any document is added.

Quickstart

From README.md
$ npm install wink-bm25-text-search
var bm25 = require( 'wink-bm25-text-search' );
var engine = bm25();
var docs = require( 'wink-bm25-text-search/sample-data/demo-data-for-wink-bm25.json' );
const winkNLP = require( 'wink-nlp' );
const model = require( 'wink-eng-lite-web-model' );
const nlp = winkNLP( model );
const its = nlp.its;
const prepTask = function ( text ) {
  const tokens = [];
  nlp.readDoc(text)
      .tokens()
      .filter( (t) => ( t.out(its.type) === 'word' && !t.out(its.stopWordFlag) ) )
      .each( (t) => tokens.push( (t.out(its.negationFlag)) ? '!' + t.out(its.stem) : t.out(its.stem) ) );
  return tokens;
};
var query;
engine.defineConfig( { fldWeights: { title: 1, body: 2 } } );
engine.definePrepTasks( [ prepTask ] );
docs.forEach( function ( doc, i ) {
  engine.addDoc( doc, i );
} );
engine.consolidate();
query = 'not studied law';
var results = engine.search( query );

wink-bm25-text-search examples

From open-source projects on GitHub

FAQ

Use MiniSearch to search app documents, especially ones users add or edit. Use Fuse.js for typo-tolerant matching over a short list, and Lunr for a static site whose index is built ahead of time. Choose Orama when an app also needs vector search.

MiniSearch is a full-text search engine that keeps its index in memory, in the browser or in Node.js. It supports prefix search, fuzzy search, and field boosts, and documents can be added or removed at any time.

FlexSearch is a full-text search library, tuned through its tokenizer and scalable with worker threads. Its persistent indexes keep the index in IndexedDB, Redis, SQLite, or another database instead of memory.

Use Fuse.js to fuzzy-match a short list of names or labels. For larger document sets, turn on the fuzzy option in MiniSearch, which scales the allowed edit distance with the length of each term.

Yes, for static sites: build the index at deploy time and load it in the browser. A Lunr index can't change after it's built, and the last release was in Aug 2020, so use MiniSearch when documents change while the app runs.

For coding agents

Found your full-text search library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official