// exchange index[i] and index[j]
778926
func (sa *SuffixArrayZ) exch(i, j int64) {
	swap := sa.index[i]
	sa.index[i] = sa.index[j]
	sa.index[j] = swap
}
1022387
func (s *ScanService) Indices(indices ...string) *ScanService {
	if s.indices == nil {
		s.indices = make([]string, 0)
	}
	s.indices = append(s.indices, indices...)
	return s
}
1337781
func (g *Group) Index(items ...Code) *Statement {
	s := Index(items...)
	g.items = append(g.items, s)
	return s
}
196281
func (api *API) Index(ctx context.Context, indexName string) (*Index, error) {
	span, _ := tracing.StartSpanFromContext(ctx, "API.Index")
	defer span.Finish()

	if err := api.validate(apiIndex); err != nil {
		return nil, errors.Wrap(err, "validating api method")
	}

	index := api.holder.Index(indexName)
	if index == nil {
		return nil, newNotFoundError(ErrIndexNotFound)
	}
	return index, nil
}
42615
func (b *IndicesCreateService) Index(index string) *IndicesCreateService {
	b.index = index
	return b
}
47730
func (s *IndicesUnfreezeService) Index(index string) *IndicesUnfreezeService {
	s.index = index
	return s
}
104734
func (pt PrimitiveTypes) Swap(i, j int) {
	pt[i], pt[j] = pt[j], pt[i]
}
1185655
func (s *FieldCapsService) Index(index ...string) *FieldCapsService {
	s.index = append(s.index, index...)
	return s
}
409028
func (s *IndicesGetFieldMappingService) Index(indices ...string) *IndicesGetFieldMappingService {
	s.index = append(s.index, indices...)
	return s
}
324619
func (b *UpdateService) Index(name string) *UpdateService {
	b.index = name
	return b
}
539247
func (s *IndicesGetSettingsService) Index(indices ...string) *IndicesGetSettingsService {
	s.index = append(s.index, indices...)
	return s
}
32206
func (c *threadSafeMap) Index(indexName string, obj interface{}) ([]interface{}, error) {
	c.lock.RLock()
	defer c.lock.RUnlock()

	indexFunc := c.indexers[indexName]
	if indexFunc == nil {
		return nil, fmt.Errorf("Index with name %s does not exist", indexName)
	}

	indexKeys, err := indexFunc(obj)
	if err != nil {
		return nil, err
	}
	index := c.indices[indexName]

	// need to de-dupe the return list.  Since multiple keys are allowed, this can happen.
	returnKeySet := sets.String{}
	for _, indexKey := range indexKeys {
		set := index[indexKey]
		for _, key := range set.List() {
			returnKeySet.Insert(key)
		}
	}

	list := make([]interface{}, 0, returnKeySet.Len())
	for absoluteKey := range returnKeySet {
		list = append(list, c.items[absoluteKey])
	}
	return list, nil
}
120172
func (txs Txs) Index(tx Tx) int {
	for i := range txs {
		if bytes.Equal(txs[i], tx) {
			return i
		}
	}
	return -1
}
1169760
func (r *ChartRepository) Index() error {
	err := r.generateIndex()
	if err != nil {
		return err
	}
	return r.saveIndexFile()
}
342416
func (s *DeleteService) Index(index string) *DeleteService {
	s.index = index
	return s
}
1183970
func (s *UpdateByQueryService) Index(index ...string) *UpdateByQueryService {
	s.index = append(s.index, index...)
	return s
}
663749
func (s *IndicesDeleteService) Index(index []string) *IndicesDeleteService {
	s.index = index
	return s
}