code: function localSearch() {
        console.log("using local search");
        var lunrIndex = lunr(function () {
          this.ref('href');
          this.field('title', { boost: 50 });
          this.field('keywords', { boost: 20 });
        });
        lunr.tokenizer.seperator = /[\s\-\.]+/;
        var searchData = {};
        var searchDataRequest = new XMLHttpRequest();
  
        var indexPath = relHref + "index.json";
        if (indexPath) {
          searchDataRequest.open('GET', indexPath);
          searchDataRequest.onload = function () {
            if (this.status != 200) {
              return;
            }
            searchData = JSON.parse(this.responseText);
            for (var prop in searchData) {
              if (searchData.hasOwnProperty(prop)){
                lunrIndex.add(searchData[prop]);
              }
            }
          }
          searchDataRequest.send();
        }
  
        $("body").bind("queryReady", function () {
          var hits = lunrIndex.search(query);
          var results = [];
          hits.forEach(function (hit) {
            var item = searchData[hit.ref];
            results.push({ 'href': item.href, 'title': item.title, 'keywords': item.keywords });
          });
          handleSearchResults(results);
        });
      }
docs: Search factory