// FieldStatistics specifies if document count, sum of document frequencies
// and sum of total term frequencies should be returned.
545518
func (s *TermvectorsService) FieldStatistics(fieldStatistics bool) *TermvectorsService {
	s.fieldStatistics = &fieldStatistics
	return s
}
600078
func (s *FieldCapsService) Fields(fields ...string) *FieldCapsService {
	s.fields = append(s.fields, fields...)
	return s
}
654439
func (p *LogicalMaxOneRow) DeriveStats(childStats []*property.StatsInfo) (*property.StatsInfo, error) {
	p.stats = getSingletonStats(p.Schema().Len())
	return p.stats, nil
}
828636
func (s *MultiTermvectorItem) TermStatistics(termStatistics bool) *MultiTermvectorItem {
	s.termStatistics = &termStatistics
	return s
}
1361562
func (z *Row) fieldsNotEmpty(isempty []bool) uint32 {
	if len(isempty) == 0 {
		return 3
	}
	var fieldsInUse uint32 = 3
	isempty[0] = (len(z.K) == 0) // string, omitempty
	if isempty[0] {
		fieldsInUse--
	}
	isempty[1] = (len(z.V) == 0) // string, omitempty
	if isempty[1] {
		fieldsInUse--
	}
	isempty[2] = (z.T == 0) // number, omitempty
	if isempty[2] {
		fieldsInUse--
	}

	return fieldsInUse
}
243085
func (c *Client) FieldCaps(indices ...string) *FieldCapsService {
	return NewFieldCapsService(c).Index(indices...)
}
679283
func (s *GetLoadBalancerMetricDataInput) SetStatistics(v []*string) *GetLoadBalancerMetricDataInput {
	s.Statistics = v
	return s
}
411545
func (s *QueryExecution) SetStatistics(v *QueryExecutionStatistics) *QueryExecution {
	s.Statistics = v
	return s
}
1329737
func TermFrequencies(document []string) Frequencies {
	words := make(map[string]int)
	for i := range document {
		words[document[i]]++
	}

	var maxFreq int
	for i := range words {
		if words[i] > maxFreq {
			maxFreq = words[i]
		}
	}

	// make frequency map
	frequencies := Frequencies{}
	for i := range words {
		frequencies = append(frequencies, Frequency{
			Word:      i,
			Frequency: 0.5 * (1 + float64(words[i])/float64(maxFreq)),
		})
	}

	return frequencies
}
1285479
func (s *ScanOp) Fields(fields []string) *ScanOp {
	s.fieldsToRead = fields
	return s
}
855535
func (s *NodesStatsService) Fields(fields ...string) *NodesStatsService {
	s.fields = append(s.fields, fields...)
	return s
}
241692
func (m *model) FolderStatistics() map[string]stats.FolderStatistics {
	res := make(map[string]stats.FolderStatistics)
	m.fmut.RLock()
	defer m.fmut.RUnlock()
	for id, runner := range m.folderRunners {
		res[id] = runner.GetStatistics()
	}
	return res
}
453472
func (c *edgeCollection) Statistics(ctx context.Context) (CollectionStatistics, error) {
	result, err := c.rawCollection().Statistics(ctx)
	if err != nil {
		return CollectionStatistics{}, WithStack(err)
	}
	return result, nil
}
378467
func (a *StatsAdapter) ListStats(patterns ...string) ([]string, error) {
	var statNames []string
	for _, stat := range a.entries {
		statNames = append(statNames, stat.Name)
	}
	return statNames, nil
}
329415
func (s *UpdateByQueryService) DocvalueFields(docvalueFields ...string) *UpdateByQueryService {
	s.docvalueFields = docvalueFields
	return s
}
140048
func (m *collection) Stats() (*CollectionStats, error) {
	rv := &CollectionStats{}

	m.stats.AtomicCopyTo(rv)

	m.m.Lock()
	m.statsSegmentsLOCKED(rv)
	m.m.Unlock()

	return rv, nil
}
899679
func (a *Allocations) Stats(args *cstructs.AllocStatsRequest, reply *cstructs.AllocStatsResponse) error {
	defer metrics.MeasureSince([]string{"client", "allocations", "stats"}, time.Now())

	// Check read job permissions
	if aclObj, err := a.c.ResolveToken(args.AuthToken); err != nil {
		return err
	} else if aclObj != nil && !aclObj.AllowNsOp(args.Namespace, acl.NamespaceCapabilityReadJob) {
		return nstructs.ErrPermissionDenied
	}

	clientStats := a.c.StatsReporter()
	aStats, err := clientStats.GetAllocStats(args.AllocID)
	if err != nil {
		return err
	}

	stats, err := aStats.LatestAllocStats(args.Task)
	if err != nil {
		return err
	}

	reply.Stats = stats
	return nil
}