Documentation ¶
Index ¶
- Constants
- Variables
- func InitConfig(cfg *config.ClvConfig)
- func Tokenizer(log []byte) []string
- type Analyzer
- type Collector
- type InvertIndex
- func IntersectExprToInvertIndex(ii *InvertIndex, expr influxql.Expr) *InvertIndex
- func IntersectInvertByDistance(pre *InvertIndex, cur *InvertIndex, dis uint16, sids []uint64) *InvertIndex
- func IntersectInvertIndexAndExpr(li, ri *InvertIndex) *InvertIndex
- func IntersectInvertIndexBySlip(li, ri *InvertIndex) *InvertIndex
- func NewInvertIndex() InvertIndex
- func UnionExprToInvertIndex(ii *InvertIndex, filter influxql.Expr) *InvertIndex
- func UnionInvertIndex(lii *InvertIndex, rii *InvertIndex, sids []uint64) *InvertIndex
- func UnionInvertIndexAndExpr(li *InvertIndex, ri *InvertIndex) *InvertIndex
- func UnionInvertIndexBySlip(li, ri *InvertIndex) *InvertIndex
- func (ii *InvertIndex) AddId(id uint32)
- func (ii *InvertIndex) AddInvertState(sid uint64, is InvertState)
- func (ii *InvertIndex) Append(sid uint64, is []InvertState)
- func (ii *InvertIndex) GetFilter() influxql.Expr
- func (ii *InvertIndex) GetRowFilterBySid(sid uint64) []RowFilter
- func (ii *InvertIndex) SetFilter(filter influxql.Expr)
- func (ii *InvertIndex) Sort(sids []uint64)
- type InvertState
- type InvertStates
- func (iss *InvertStates) GetInvertStateByRowId(rowId int64) *InvertState
- func (iss *InvertStates) InvertIsExisted(is InvertState) bool
- func (iss *InvertStates) InvertRowIdIsExisted(rowId int64) bool
- func (iss *InvertStates) Len() int
- func (iss *InvertStates) Less(i, j int) bool
- func (iss *InvertStates) Swap(i, j int)
- type Logs
- type MergerPool
- type Options
- type QueryType
- type RowFilter
- type RowFilters
- type SimpleTokenizer
- type TokenIndex
- func (idx *TokenIndex) AddDocument(log string, sid uint64, rowId int64) error
- func (idx *TokenIndex) Analyse() *TrieNode
- func (idx *TokenIndex) Close()
- func (idx *TokenIndex) Flush()
- func (idx *TokenIndex) Fuzzy(queryStr string, sids []uint64) (*InvertIndex, error)
- func (idx *TokenIndex) Match(queryStr string, sids []uint64) (*InvertIndex, error)
- func (idx *TokenIndex) MatchPhrase(queryStr string, sids []uint64) (*InvertIndex, error)
- func (idx *TokenIndex) Open() error
- func (idx *TokenIndex) Search(t QueryType, queryStr string, sids []uint64) (*InvertIndex, error)
- type TrieNode
- type VToken
Constants ¶
View Source
const ( Unknown uint32 = 0 Default uint32 = 1 )
dictonary version
View Source
const ( Stopped int32 = 0 Collecting int32 = 1 Flushing int32 = 2 )
the status of collector
View Source
const (
DefaultCap = 16
)
View Source
const (
DefaultSplitGram = ", '\";=()[]{}?@&<>/:\n\t\r"
)
Variables ¶
View Source
var MaxDocCount uint32 = 500000
View Source
var MaxRetry int32 = 3
View Source
var Qmax = 7
View Source
var TokenThreshold = 100
Functions ¶
func InitConfig ¶
Types ¶
type Analyzer ¶
type Analyzer struct {
// contains filtered or unexported fields
}
func GetAnalyzer ¶
* return a analyzer by version. * The analyzer's location: path/name/field/MergeSetTable
func (*Analyzer) FindVtokenByID ¶
func (*Analyzer) InsertToDictionary ¶
func (*Analyzer) RegisterCollector ¶
type InvertIndex ¶
type InvertIndex struct {
// contains filtered or unexported fields
}
func IntersectExprToInvertIndex ¶
func IntersectExprToInvertIndex(ii *InvertIndex, expr influxql.Expr) *InvertIndex
func IntersectInvertByDistance ¶
func IntersectInvertByDistance(pre *InvertIndex, cur *InvertIndex, dis uint16, sids []uint64) *InvertIndex
func IntersectInvertIndexAndExpr ¶
func IntersectInvertIndexAndExpr(li, ri *InvertIndex) *InvertIndex
func IntersectInvertIndexBySlip ¶
func IntersectInvertIndexBySlip(li, ri *InvertIndex) *InvertIndex
func NewInvertIndex ¶
func NewInvertIndex() InvertIndex
func UnionExprToInvertIndex ¶
func UnionExprToInvertIndex(ii *InvertIndex, filter influxql.Expr) *InvertIndex
func UnionInvertIndex ¶
func UnionInvertIndex(lii *InvertIndex, rii *InvertIndex, sids []uint64) *InvertIndex
func UnionInvertIndexAndExpr ¶
func UnionInvertIndexAndExpr(li *InvertIndex, ri *InvertIndex) *InvertIndex
Union's principle: (1) the part of same data, use the union of lexpr and rexpr; (2) only the part of LHS, use the lexpr; (3) only the part of RHS, use the rexpr;
func UnionInvertIndexBySlip ¶
func UnionInvertIndexBySlip(li, ri *InvertIndex) *InvertIndex
func (*InvertIndex) AddId ¶
func (ii *InvertIndex) AddId(id uint32)
func (*InvertIndex) AddInvertState ¶
func (ii *InvertIndex) AddInvertState(sid uint64, is InvertState)
func (*InvertIndex) Append ¶
func (ii *InvertIndex) Append(sid uint64, is []InvertState)
func (*InvertIndex) GetFilter ¶
func (ii *InvertIndex) GetFilter() influxql.Expr
func (*InvertIndex) GetRowFilterBySid ¶
func (ii *InvertIndex) GetRowFilterBySid(sid uint64) []RowFilter
func (*InvertIndex) SetFilter ¶
func (ii *InvertIndex) SetFilter(filter influxql.Expr)
func (*InvertIndex) Sort ¶
func (ii *InvertIndex) Sort(sids []uint64)
type InvertState ¶
type InvertState struct {
// contains filtered or unexported fields
}
type InvertStates ¶
type InvertStates struct {
// contains filtered or unexported fields
}
func NewInvertStates ¶
func NewInvertStates() *InvertStates
func NewInvertStatesAndIntersect ¶
func NewInvertStatesAndIntersect(sid uint64, invertState []InvertState, expr influxql.Expr) *InvertStates
func NewInvertStatesAndUion ¶
func NewInvertStatesAndUion(sid uint64, invertState []InvertState, filter influxql.Expr) *InvertStates
func (*InvertStates) GetInvertStateByRowId ¶
func (iss *InvertStates) GetInvertStateByRowId(rowId int64) *InvertState
func (*InvertStates) InvertIsExisted ¶
func (iss *InvertStates) InvertIsExisted(is InvertState) bool
func (*InvertStates) InvertRowIdIsExisted ¶
func (iss *InvertStates) InvertRowIdIsExisted(rowId int64) bool
func (*InvertStates) Len ¶
func (iss *InvertStates) Len() int
Len is the number of elements in the InvertStates.
func (*InvertStates) Less ¶
func (iss *InvertStates) Less(i, j int) bool
i < j. if Less() return false, should call Swap()
func (*InvertStates) Swap ¶
func (iss *InvertStates) Swap(i, j int)
Swap swaps the elements with indexes i and j.
type MergerPool ¶
type MergerPool struct {
// contains filtered or unexported fields
}
func (*MergerPool) Get ¶
func (mp *MergerPool) Get() *merger
func (*MergerPool) Put ¶
func (mp *MergerPool) Put(m *merger)
type RowFilters ¶
type RowFilters struct {
RowFilters [][]RowFilter
}
func NewRowFilters ¶
func NewRowFilters() *RowFilters
func (*RowFilters) Append ¶
func (rfs *RowFilters) Append(rowFilter []RowFilter)
func (*RowFilters) GetRowFilter ¶
func (rfs *RowFilters) GetRowFilter(idx int) *[]RowFilter
func (*RowFilters) Reset ¶
func (rfs *RowFilters) Reset()
func (*RowFilters) Swap ¶
func (rfs *RowFilters) Swap(i, j int)
type SimpleTokenizer ¶
type SimpleTokenizer struct {
// contains filtered or unexported fields
}
func NewDefaultSimpleTokenzier ¶
func NewDefaultSimpleTokenzier() *SimpleTokenizer
func NewSimpleTokenizer ¶
func NewSimpleTokenizer() *SimpleTokenizer
func (*SimpleTokenizer) Next ¶
func (t *SimpleTokenizer) Next() bool
func (*SimpleTokenizer) SetData ¶
func (t *SimpleTokenizer) SetData(data []byte)
func (*SimpleTokenizer) SetSplitGram ¶
func (t *SimpleTokenizer) SetSplitGram(splitGram string)
init the split-gram-table
func (*SimpleTokenizer) Token ¶
func (t *SimpleTokenizer) Token() []byte
type TokenIndex ¶
type TokenIndex struct {
// contains filtered or unexported fields
}
func NewTokenIndex ¶
func NewTokenIndex(opts *Options) (*TokenIndex, error)
func (*TokenIndex) AddDocument ¶
func (idx *TokenIndex) AddDocument(log string, sid uint64, rowId int64) error
func (*TokenIndex) Analyse ¶
func (idx *TokenIndex) Analyse() *TrieNode
func (*TokenIndex) Close ¶
func (idx *TokenIndex) Close()
func (*TokenIndex) Flush ¶
func (idx *TokenIndex) Flush()
func (*TokenIndex) Fuzzy ¶
func (idx *TokenIndex) Fuzzy(queryStr string, sids []uint64) (*InvertIndex, error)
func (*TokenIndex) Match ¶
func (idx *TokenIndex) Match(queryStr string, sids []uint64) (*InvertIndex, error)
func (*TokenIndex) MatchPhrase ¶
func (idx *TokenIndex) MatchPhrase(queryStr string, sids []uint64) (*InvertIndex, error)
func (*TokenIndex) Open ¶
func (idx *TokenIndex) Open() error
func (*TokenIndex) Search ¶
func (idx *TokenIndex) Search(t QueryType, queryStr string, sids []uint64) (*InvertIndex, error)
if not found any matched text, need return a empty InvertIndex, not nil InvertIndex.
type TrieNode ¶
type TrieNode struct {
// contains filtered or unexported fields
}
func NewTrieNode ¶
func NewTrieNode() *TrieNode
Click to show internal directories.
Click to hide internal directories.