Documentation ¶
Overview ¶
Package index implements the index system for searching data.
Index ¶
- Constants
- Variables
- type Batch
- type Document
- type DocumentResult
- type Documents
- type Field
- type FieldIterable
- type FieldIterator
- type FieldKey
- type Filter
- type GetSearcher
- type Query
- type RangeOpts
- type Searcher
- type Series
- type SeriesDocument
- type SeriesMatcher
- type SeriesMatcherType
- type SeriesStore
- type Store
- type Writer
Constants ¶
const ( // AnalyzerUnspecified represents an unspecified analyzer. AnalyzerUnspecified = "" // AnalyzerKeyword is a “noop” analyzer which returns the entire input string as a single token. AnalyzerKeyword = "keyword" // AnalyzerSimple breaks text into tokens at any non-letter character. AnalyzerSimple = "simple" // AnalyzerStandard provides grammar based tokenization. AnalyzerStandard = "standard" // AnalyzerURL breaks test into tokens at any non-letter and non-digit character. AnalyzerURL = "url" )
Variables ¶
var DummyFieldIterator = &dummyIterator{}
DummyFieldIterator never iterates.
Functions ¶
This section is empty.
Types ¶
type Batch ¶ added in v0.6.0
type Batch struct {
Documents Documents
}
Batch is a collection of documents.
type DocumentResult ¶ added in v0.7.0
type DocumentResult struct { EntityValues []byte Values map[string][]byte SortedValue []byte SeriesID common.SeriesID DocID uint64 Timestamp int64 }
DocumentResult represents a document in an index.
func (DocumentResult) SortedField ¶ added in v0.7.0
func (ir DocumentResult) SortedField() []byte
SortedField returns the value of the sorted field.
type FieldIterable ¶
type FieldIterable interface { BuildQuery(seriesMatchers []SeriesMatcher, secondaryQuery Query) (Query, error) Iterator(ctx context.Context, fieldKey FieldKey, termRange RangeOpts, order modelv1.Sort, preLoadSize int) (iter FieldIterator[*DocumentResult], err error) Sort(ctx context.Context, sids []common.SeriesID, fieldKey FieldKey, order modelv1.Sort, timeRange *timestamp.TimeRange, preLoadSize int) (FieldIterator[*DocumentResult], error) }
FieldIterable allows building a FieldIterator.
type FieldIterator ¶
type FieldIterator[T sort.Comparable] interface { Next() bool Val() T Close() error Query() Query }
FieldIterator allows iterating over a field's posting values.
type Filter ¶ added in v0.2.0
type Filter interface { fmt.Stringer Execute(getSearcher GetSearcher, seriesID common.SeriesID) (posting.List, error) }
Filter is a node in the filter tree.
type GetSearcher ¶ added in v0.2.0
type GetSearcher func(location databasev1.IndexRule_Type) (Searcher, error)
GetSearcher returns a searcher associated with input index rule type.
type Searcher ¶
type Searcher interface { FieldIterable Match(fieldKey FieldKey, match []string, opts *modelv1.Condition_MatchOption) (list posting.List, err error) MatchField(fieldKey FieldKey) (list posting.List, err error) MatchTerms(field Field) (list posting.List, err error) Range(fieldKey FieldKey, opts RangeOpts) (list posting.List, err error) }
Searcher allows searching a field either by its key or by its key and term.
type Series ¶ added in v0.6.0
Series represents a series in an index.
func (Series) SortedField ¶ added in v0.7.1
SortedField returns the value of the sorted field.
type SeriesDocument ¶ added in v0.7.0
SeriesDocument represents a series document in an index.
type SeriesMatcher ¶ added in v0.6.0
type SeriesMatcher struct { Match []byte Type SeriesMatcherType }
SeriesMatcher represents a series matcher.
func (SeriesMatcher) String ¶ added in v0.6.1
func (s SeriesMatcher) String() string
String returns a string representation of the series matcher.
type SeriesMatcherType ¶ added in v0.6.0
type SeriesMatcherType int
SeriesMatcherType represents the type of series matcher.
const ( // SeriesMatcherTypeExact represents an exact matcher. SeriesMatcherTypeExact SeriesMatcherType = iota // SeriesMatcherTypePrefix represents a prefix matcher. SeriesMatcherTypePrefix // SeriesMatcherTypeWildcard represents a wildcard matcher. SeriesMatcherTypeWildcard )
type SeriesStore ¶ added in v0.6.0
type SeriesStore interface { Store // Search returns a list of series that match the given matchers. Search(context.Context, []FieldKey, Query) ([]SeriesDocument, error) SeriesIterator(context.Context) (FieldIterator[Series], error) SeriesSort(ctx context.Context, fieldKey FieldKey, termRange RangeOpts, order modelv1.Sort, preLoadSize int, query Query, fieldKeys []FieldKey) (iter FieldIterator[*DocumentResult], err error) }
SeriesStore is an abstract of a series repository.
Directories ¶
Path | Synopsis |
---|---|
Package inverted implements an inverted index repository.
|
Package inverted implements an inverted index repository. |
Package posting implements a posting list contains a list of document ids.
|
Package posting implements a posting list contains a list of document ids. |
roaring
Package roaring implements the posting list by a roaring bitmap.
|
Package roaring implements the posting list by a roaring bitmap. |
Package testcases implements common helpers for testing inverted and lsm indices.
|
Package testcases implements common helpers for testing inverted and lsm indices. |