Documentation ¶
Overview ¶
Package index implements the index system for searching data.
Index ¶
- Variables
- func FieldStr(key FieldKey, term []byte) string
- func UnmarshalTerm(raw []byte) []byte
- type Batch
- type Document
- type Documents
- type Field
- type FieldIterable
- type FieldIterator
- type FieldKey
- type Filter
- type GetSearcher
- type RangeOpts
- type Searcher
- type Series
- type SeriesMatcher
- type SeriesMatcherType
- type SeriesStore
- type Store
- type Writer
Constants ¶
This section is empty.
Variables ¶
var DummyFieldIterator = &dummyIterator{}
DummyFieldIterator never iterates.
Functions ¶
func FieldStr ¶ added in v0.3.0
FieldStr return a string represent of Field which is composed by key and term.
func UnmarshalTerm ¶ added in v0.3.0
UnmarshalTerm decodes term from a encoded field.
Types ¶
type Batch ¶ added in v0.6.0
type Batch struct { Applied chan struct{} Documents Documents }
Batch is a collection of documents.
type FieldIterable ¶
type FieldIterable interface { Iterator(fieldKey FieldKey, termRange RangeOpts, order modelv1.Sort, preLoadSize int) (iter FieldIterator, err error) Sort(sids []common.SeriesID, fieldKey FieldKey, order modelv1.Sort, preLoadSize int) (FieldIterator, error) }
FieldIterable allows building a FieldIterator.
type FieldIterator ¶
FieldIterator allows iterating over a field's posting values.
type FieldKey ¶
type FieldKey struct { SeriesID common.SeriesID IndexRuleID uint32 Analyzer databasev1.IndexRule_Analyzer }
FieldKey is the key of field in a document.
func (FieldKey) Equal ¶
Equal reports whether f and other have the same series id and index rule id.
func (FieldKey) HasSeriesID ¶ added in v0.4.0
HasSeriesID reports whether f has a series id.
func (FieldKey) MarshalIndexRule ¶ added in v0.3.0
MarshalIndexRule encodes the index rule id to string representation.
func (FieldKey) MarshalToStr ¶ added in v0.2.0
MarshalToStr encodes f to string.
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) (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 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, []SeriesMatcher) ([]Series, error) }
SeriesStore is an abstract of a series repository.
Directories ¶
Path | Synopsis |
---|---|
Package inverted implements a inverted index repository.
|
Package inverted implements a 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. |