getIndex (name) {
    const index = name ? this.indexes[name] : this.index
    if (!index) {
      throw utils.err(`${DOMAIN}#getIndex`, name)(404, 'index')
    }
    return index
  }
Return the index with the given name. If no name is provided, return the
main index. Throws an error if the specified index does not exist.

@method Collection#getIndex
@since 3.0.0
@param {string} [name] The name of the index to retrieve.