1.0.0
July 19, 2021 ยท View on GitHub
Changelog
2.0.0
- Bumped uuid from 2.0.1 to 8.3.2 to support ES modules
1.4.1
1.4.0
- Added support for optional OR searches (documents matching only some of the search tokens) (@dlebech - #19)
1.3.0
1.2.1
Worker onerror method properly handles undefined event.data for errors during eg indexDocument. (This avoids causing a secondary error, as reported in bvaughn/redux-search/issues/69).)
1.2.0
Added support for custom tokenizer patterns and case-sensitive search.
// Case-sensitive exact word search with custom tokenizer RegExp
// to include all non alphanumerics as delimeters
// ex: searching "Swift" will match "Thomas Swift" and "Thomas (Swift)" but not "the swift dog"
const searchApi = new SearchApi({
indexMode: INDEX_MODES.EXACT_WORDS,
tokenizePattern: /[^a-z0-9]+/,
caseSensitive: true
})
1.1.1
1.1.0
Added support for custom index strategies. By default, a prefix matching strategy is still used but it can be overridden like so:
import SearchApi, { INDEX_MODES } from 'js-worker-search'
// all-substrings match by default; same as current
// eg "c", "ca", "a", "at", "cat" match "cat"
const searchApi = new SearchApi()
// prefix matching (eg "c", "ca", "cat" match "cat")
const searchApi = new SearchApi({
indexMode: INDEX_MODES.PREFIXES
})
// exact words matching (eg only "cat" matches "cat")
const searchApi = new SearchApi({
indexMode: INDEX_MODES.EXACT_WORDS
})
1.0.2
Wrapped String.prototype.charAt usage in a try/catch to avoid erroring when handling surrogate halves.
In the context of a web-worker, non-BMP characters seem to cause Chrome 49.0 to crash.
1.0.1
Bound indexSearch and search methods to prevent them from losing context when passed around.
1.0.0
Initial release; forked from redux-search.