code: func (i *Index) AddRepo(rname string, ind *repo.IndexFile, all bool) {
  	ind.SortEntries()
  	for name, ref := range ind.Entries {
  		if len(ref) == 0 {
  			// Skip chart names that have zero releases.
  			continue
  		}
  		// By convention, an index file is supposed to have the newest at the
  		// 0 slot, so our best bet is to grab the 0 entry and build the index
  		// entry off of that.
  		// Note: Do not use filePath.Join since on Windows it will return \
  		//       which results in a repo name that cannot be understood.
  		fname := path.Join(rname, name)
  		if !all {
  			i.lines[fname] = indstr(rname, ref[0])
  			i.charts[fname] = ref[0]
  			continue
  		}
  
  		// If 'all' is set, then we go through all of the refs, and add them all
  		// to the index. This will generate a lot of near-duplicate entries.
  		for _, rr := range ref {
  			versionedName := fname + verSep + rr.Version
  			i.lines[versionedName] = indstr(rname, rr)
  			i.charts[versionedName] = rr
  		}
  	}
  }
docs: // AddRepo adds a repository index to the search index.