code: function loadIndex(searchInfo /*: SearchInfo */) {
    return function(index) {
      // Store the pages data to be used in mapping query results back to pages
      // Add search terms from each page to the search index
      searchInfo.forEach(function(page /*: PageInfo */) {
        index.add(page);
        pages[page.path] = page;
      });
    };
  }
docs: Create the search index from the searchInfo which contains the information about each page to be indexed