code: function(index, model) {
      var itemToIndex = {};
      // index all available fields for the item
      for (var i in this.config.indexes[index].indexFields) {
        var name = this.config.indexes[index].indexFields[i].name;
        if (typeof model.attributes[name] !== 'undefined' &&
            model.attributes[name] !== null) {
          var value = model.attributes[name];
          // first convert arrays to strings (we assume they are arrays of strings)
          if (Array.isArray(value)) {
            value = value.join(' ');
          }
          itemToIndex[name] = value;
        } else {
          itemToIndex[name] = '';
        }
      }
      // set the unique identifier
      itemToIndex.cid = model.cid;
      // index the item
      this.config.indexes[index].idx.add(itemToIndex);
  
      var itemForContent = {};
      // save all available content for the item
      for (var i in this.config.indexes[index].contentFields) {
        var name = this.config.indexes[index].contentFields[i].name;
        if (typeof model.attributes[name] !== 'undefined' &&
            model.attributes[name] !== null) {
          itemForContent[name] = model.attributes[name];
        }
      }
      // save it, keyed to its cid, for easy retrieval
      this.config.indexes[index].content[model.cid] = itemForContent;
    }
docs: /*
  This indexes one item and gathers its content