code: function () {
          var matchedItems = packages;
          var parsed = this.parseQuery(this.query);
          var query = parsed.query;
          var fields = parsed.field ? [parsed.field] :
            _.filter(Object.keys(config.searchField), function (key) {
              return config.searchField[key];
            });
          var exact = !!parsed.field;
  
          matchedItems = this.filter(matchedItems);
          matchedItems = this.find(matchedItems, query, fields, exact);
          matchedItems = this.dedupe(matchedItems);
          matchedItems = this.sort(matchedItems, this.sorting, this.order);
          matchedItems = !exact ? this.prioritize(matchedItems, query) : matchedItems;
  
          this.count = matchedItems.length;
          this.pageCount = Math.ceil(this.count / this.limit);
          this.from = (this.page - 1) * this.limit + 1;
          this.to =  this.from + this.limit - 1 > this.count ? this.count : this.from + this.limit - 1;
          this.results = matchedItems.slice(this.from - 1, this.to);
        }
docs: Search packages