Documentation
¶
Overview ¶
Package index implements the index system for searching data.
Index ¶
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 FieldIterable ¶
type FieldIterable interface {
Iterator(fieldKey FieldKey, termRange RangeOpts, order modelv1.Sort) (iter FieldIterator, err error)
}
FieldIterable allows building a FieldIterator.
type FieldIterator ¶
type FieldIterator interface {
Next() bool
Val() *PostingValue
Close() error
}
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) 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 PostingValue ¶
PostingValue is the collection of a field's values.
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 Store ¶
type Store interface {
observability.Observable
io.Closer
Writer
Searcher
}
Store is an abstract of a index repository.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package inverted implements a inverted index repository.
|
Package inverted implements a inverted index repository. |
|
Package lsm implements a tree-based index repository.
|
Package lsm implements a tree-based 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. |