Redux bindings for client-side search
Higher-order Redux library for searching collections of objects. Search algorithms powered by js-worker-search.
Check out the live demo at bvaughn.github.io/redux-search
Or install it yourself with NPM:
npm install --save redux-search
This README provides a quick introduction of redux-search. For more details refer to the API documentation.
redux-search searches collections of documents and returns results as an Array of document ids. It is important to note that the documents themselves aren't returned. This is because the actual search is performed in a web-worker thread for performance reasons. In order to avoid serializing the documents and passing them back and forth, redux-search simply passes their ids.
Because of this, each document must contain an id attribute.
redux-search provides an action for searching resources as well as selectors for getting search results and the current search text. It then watches the store for resource changes and automatically updates search results as needed.
Note that redux-search currently depends on the Regenerator runtime. It is recommended that your project require the babel-polyfill to provide that runtime.
redux-search watches the store for changes to searchable collections and automatically builds a search index. To do this, it simply needs to be told which resources to watch and which fields to index.
…
By default, redux-search builds an index to match all substrings.
You can override this behavior by providing your own, pre-configured searchApi param to the middleware like so:
…
You can also pass parameters to the SearchApi constructor that customize the way the search splits up the text into words (tokenizes), change the search from the default case-insensitive to case-sensitive and/or enable matching on any search token (changing the search filtering from AND to OR):
…
redux-search provides selectors and action-creators for easily connecting components with the search state. For example, using reselect you might connect your component like so:
…
Changes are tracked in the changelog.
redux-search is available under the MIT License.
No open issues yet, or sync has not completed.