minisearch
Advanced tools
Changelog
v5.1.0
processTerm
option can now also expand a single term into several
terms by returning an array of strings.
logger
option to pass a custom logger function.Changelog
v5.0.0
This is a major release. The main change is an improved scoring algorithm based on BM25+. The new algorithm will cause the scoring and sorting of search results to be different than in previous versions (generally better), and need less aggressive boosting.
[breaking change] Use the BM25+ algorithm to score search results, improving their quality over the previous implementation. Note that, if you were using field boosting, you might need to re-adjust the boosting amounts, since their effect is now different.
[breaking change] auto suggestions now default to combineWith: 'AND'
instead of 'OR'
, requiring all the query terms to match. The old defaults
can be replicated by passing a new autoSuggestOptions
option to the
constructor, with value { autoSuggestOptions: { combineWith: 'OR' } }
.
Possibility to set the default auto suggest options in the constructor.
Remove redundant fields in the index data. This also changes the
serialization format, but serialized indexes created with v4.x.y
are still
deserialized correctly.
Define exports
entry points in package.json
, to require MiniSearch as a
commonjs package or import it as a ES module.
Changelog
v4.0.1
[fix] Fix an issue with scoring, causing a result matching both fuzzy and prefix search to be scored higher than an exact match.
SearchableMap
method fuzzyGet
now returns a Map
instead of an object. This is a breaking change only if you directly use
SearchableMap
, not if you use MiniSearch
, and is considered part of
version 4.Changelog
v4.0.0
[breaking change] The serialization format was changed, to abstract away the internal implementation details of the index data structure. This allows for present and future optimizations without breaking backward compatibility again. Moreover, the new format is simpler, facilitating the job of tools that create a serialized MiniSearch index in other languages.
[performance] Large performance improvements on indexing (at least 4 time faster in the official benchmark) and search, due to changes to the internal data structures and the code.
[peformance] The fuzzy search algorithm has been updated to work like outlined in this blog post by Steve Hanov, improving its performance by several times, especially on large maximum edit distances.
[fix] The weights
search option did not have an effect due to a bug. Now
it works as documented. Note that, due to this, the relative scoring of
fuzzy vs. prefix search matches might change compared to previous versions.
This change also brings a further performance improvement of both fuzzy and
prefix search.
Migration notes:
If you have an index serialized with a previous version of MiniSearch, you will
need to re-create it when you upgrade to MiniSearch v4
.
Also note that loading a pre-serialized index is slower in v4
than in
previous versions, but there are much larger performance gains on indexing and
search speed. If you serialized an index on the server-side, it is worth
checking if it is now fast enough for your use case to index on the client side:
it would save you from having to re-serialize the index every time something
changes.
Acknowledgements:
Many thanks to rolftimmermans for contributing the fixes and outstanding performance improvements that are part of this release.