redux-search v2.2.0 Release Notes

Release Date: 2016-08-24 // over 3 years ago
  • ➕ Added support for configurable index strategy (supported in js-worker-search version 1.1.0). 0️⃣ Search users can now choose between all-substring matches (default), prefix matches, and exact word matches only. 🔧 To override the default, simply pass a configured SearchApi argument to the reduxSearch middleware like so:

    import { reduxSearch, SearchApi, INDEX_MODES } from 'redux-search'
    
    const indexMode = INDEX_MODES.PREFIXES || INDEX_MODES.EXACT_WORDS || INDEX_MODES.ALL_SUBSTRINGS
    
    const finalCreateStore = compose(
      // Other middleware ...
      reduxSearch({
        resourceIndexes: { ... },
        resourceSelector: (resourceName, state) => state.resources.get(resourceName),
        searchApi: new SearchApi({ indexMode })
      })
    )(createStore)