How to use the lunr.index function in lunr

To help you get started, we’ve selected a few lunr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github swennemans / redux-lunr / src / middleware.js View on Github external
next(searchLunr);
          let results = options.store.existingStore ?
              retrieveResultsFromState(getState, options, doLunrSearch(getState, _query)) :
              retrieveResultsFromStore(getState, doLunrSearch(getState, _query));

          next({
            type: LUNR_SEARCH_SUCCESS,
            results: _limit ? results.slice(0, _limit) : results,
            query: _query
          });
          break;
        case LUNR_LOAD_SEARCH_INDEX:
          next(searchLunr);
            next({
              type: LUNR_LOAD_SEARCH_INDEX_SUCCESS,
              searchIndex: lunr.index.load(JSON.parse(_index))
            });
          break;
        case LUNR_SEARCH_RESET:
          next(searchLunr);
          break;
        default:
          throw new UnreconizedActionTypeException('Unknown action, ' + type);
      }
    }
  }