Documentation
¶
Index ¶
- func IndexFetch(ids []seq.ID, sw *stopwatch.Stopwatch, fetchIndex fetchIndex, res [][]byte) error
- func IndexSearch(ctx context.Context, params SearchParams, index searchIndex, ...) (*seq.QPR, error)
- func MergeQPRs(qprs []*seq.QPR, params SearchParams) *seq.QPR
- type AggBin
- type AggLimits
- type AggQuery
- type Aggregator
- type ExtractMIDFunc
- type SearchParams
- type SingleSourceCountAggregator
- type SingleSourceHistogramAggregator
- type SingleSourceUniqueAggregator
- type SourcedNodeIterator
- type TwoSourceAggregator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IndexFetch ¶
func IndexSearch ¶
Types ¶
type AggBin ¶
type AggBin[T comparable] struct { MID seq.MID Source T }
AggBin is a container for documents which were written in the same time interval. When dealing with aggregation (without need in building time series) [AggBin.MID] is equal to [DummyMID].
type Aggregator ¶
type Aggregator interface {
// Next iterates to count the next lid.
Next(lid uint32) error
// Aggregate processes and returns the final aggregation result.
Aggregate() (seq.AggregatableSamples, error)
}
type ExtractMIDFunc ¶
ExtractMIDFunc is necessary since in aggregators we do not have [idsIndex] interface, we need a way to extract timestamp of document to build time series.
type SearchParams ¶
type SearchParams struct {
AST *parser.ASTNode `json:"-"`
AggQ []AggQuery
HistInterval uint64
From seq.MID
To seq.MID
Limit int
WithTotal bool
Order seq.DocsOrder
}
func (*SearchParams) HasAgg ¶
func (p *SearchParams) HasAgg() bool
func (*SearchParams) HasHist ¶
func (p *SearchParams) HasHist() bool
func (*SearchParams) IsScanAllRequest ¶
func (p *SearchParams) IsScanAllRequest() bool
type SingleSourceCountAggregator ¶
type SingleSourceCountAggregator struct {
// contains filtered or unexported fields
}
SingleSourceCountAggregator aggregates counts for a single source.
func NewSingleSourceCountAggregator ¶
func NewSingleSourceCountAggregator( iterator *SourcedNodeIterator, fn ExtractMIDFunc, ) *SingleSourceCountAggregator
func (*SingleSourceCountAggregator) Aggregate ¶
func (n *SingleSourceCountAggregator) Aggregate() (seq.AggregatableSamples, error)
func (*SingleSourceCountAggregator) Next ¶
func (n *SingleSourceCountAggregator) Next(lid uint32) error
Next iterates over groupBy tree to count occurrence.
type SingleSourceHistogramAggregator ¶
type SingleSourceHistogramAggregator struct {
// contains filtered or unexported fields
}
func NewSingleSourceHistogramAggregator ¶
func NewSingleSourceHistogramAggregator( field *SourcedNodeIterator, collectSamples bool, fn ExtractMIDFunc, ) *SingleSourceHistogramAggregator
func (*SingleSourceHistogramAggregator) Aggregate ¶
func (n *SingleSourceHistogramAggregator) Aggregate() (seq.AggregatableSamples, error)
func (*SingleSourceHistogramAggregator) Next ¶
func (n *SingleSourceHistogramAggregator) Next(lid uint32) error
type SingleSourceUniqueAggregator ¶
type SingleSourceUniqueAggregator struct {
// contains filtered or unexported fields
}
SingleSourceUniqueAggregator aggregates unique values for a single source.
func NewSingleSourceUniqueAggregator ¶
func NewSingleSourceUniqueAggregator(iterator *SourcedNodeIterator) *SingleSourceUniqueAggregator
func (*SingleSourceUniqueAggregator) Aggregate ¶
func (n *SingleSourceUniqueAggregator) Aggregate() (seq.AggregatableSamples, error)
func (*SingleSourceUniqueAggregator) Next ¶
func (n *SingleSourceUniqueAggregator) Next(lid uint32) error
Next iterates over groupBy tree to count occurrence.
type SourcedNodeIterator ¶
type SourcedNodeIterator struct {
// contains filtered or unexported fields
}
SourcedNodeIterator can iterate the sourced node that returns source, which means index in a tids slice.
func NewSourcedNodeIterator ¶
func NewSourcedNodeIterator(sourced node.Sourced, ti tokenIndex, tids []uint32, limit iteratorLimit, reverse bool) *SourcedNodeIterator
func (*SourcedNodeIterator) ConsumeTokenSource ¶
func (s *SourcedNodeIterator) ConsumeTokenSource(lid uint32) (uint32, bool, error)
func (*SourcedNodeIterator) UniqueSources ¶
func (s *SourcedNodeIterator) UniqueSources() int
func (*SourcedNodeIterator) ValueBySource ¶
func (s *SourcedNodeIterator) ValueBySource(source uint32) string
type TwoSourceAggregator ¶
type TwoSourceAggregator struct {
// contains filtered or unexported fields
}
TwoSourceAggregator implements Aggregator interface and can iterate over groupBy and field node.Sourced to collect a histogram.
func NewGroupAndFieldAggregator ¶
func NewGroupAndFieldAggregator( fieldIterator, groupByIterator *SourcedNodeIterator, fn ExtractMIDFunc, collectSamples bool, ) *TwoSourceAggregator
func (*TwoSourceAggregator) Aggregate ¶
func (n *TwoSourceAggregator) Aggregate() (seq.AggregatableSamples, error)
Aggregate processes and returns the final aggregation result.
func (*TwoSourceAggregator) Next ¶
func (n *TwoSourceAggregator) Next(lid uint32) error
Next iterates over groupBy and field iterators (actually trees) to count occurrence.