docs: function handleMessage(message) {
    var type = message.data.type;
    var id = message.data.id;
    var payload = message.data.payload;
    switch(type) {
      case 'load-index':
        makeRequest(SEARCH_TERMS_URL, function(searchInfo) {
          index = createIndex(loadIndex(searchInfo));
          self.postMessage({type: type, id: id, payload: true});
        });
        break;
      case 'query-index':
        self.postMessage({type: type, id: id, payload: {query: payload, results: queryIndex(payload)}});
        break;
      default:
        self.postMessage({type: type, id: id, payload: {error: 'invalid message type'}})
    }
  }