Documentation
¶
Index ¶
- func NewAnd(left, right Node) *nodeAnd
- func NewNAnd(negative, regular Node) *nodeNAnd
- func NewNot(child Node, minID, maxID LID) *nodeNot
- func NewOr(left, right Node) *nodeOr
- func NewRange(minVal, maxVal LID) *nodeRange
- func OrMulti(batches []LIDBatch, desc bool) (result LIDBatch, residuals []LIDBatch)
- func TreeFold[V any](op func(V, V) V, def V, values []V) V
- type BatchedNode
- func EmptyBatched() BatchedNode
- func NewAndBatched(left, right BatchedNode, desc bool) BatchedNode
- func NewBatcherNode(source Node, desc bool) BatchedNode
- func NewNAndBatched(neg, reg BatchedNode, desc bool) BatchedNode
- func NewOrBatched(left, right BatchedNode, desc bool) BatchedNode
- func NewOrBatchedMulti(children []BatchedNode, desc bool) BatchedNode
- func NewStaticBatched(data []uint32, reverse bool) BatchedNode
- type Iter
- type LID
- type LIDBatch
- func And(left, right LIDBatch, desc bool) (result, leftResidual, rightResidual LIDBatch)
- func AndNot(reg, neg LIDBatch, desc bool) (result, regResidual, negResidual LIDBatch)
- func EmptyBatch() LIDBatch
- func NewBitmapBatch(b *roaring.Bitmap) LIDBatch
- func NewBitmapBatchFromLids(lids []uint32) LIDBatch
- func NewSliceBatch(lids []uint32) LIDBatch
- func Or(left, right LIDBatch, desc bool) (result, leftResidual, rightResidual LIDBatch)
- type ManyIter
- type Node
- type Sourced
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BatchedNode ¶ added in v0.72.0
type BatchedNode interface {
fmt.Stringer
// NextBatch returns next batch. Returns empty batch when exhausted.
NextBatch() LIDBatch
// NextBatchGeq returns next batch (LIDs >= minLID). Returns empty batch when exhausted.
NextBatchGeq(nextID LID) LIDBatch
}
func EmptyBatched ¶ added in v0.77.0
func EmptyBatched() BatchedNode
func NewAndBatched ¶ added in v0.77.0
func NewAndBatched(left, right BatchedNode, desc bool) BatchedNode
NewAndBatched returns a BatchedNode that intersects two batched iterators. desc is the document traversal order for NextBatch / NextBatchGeq.
func NewBatcherNode ¶ added in v0.77.0
func NewBatcherNode(source Node, desc bool) BatchedNode
func NewNAndBatched ¶ added in v0.77.0
func NewNAndBatched(neg, reg BatchedNode, desc bool) BatchedNode
func NewOrBatched ¶ added in v0.77.0
func NewOrBatched(left, right BatchedNode, desc bool) BatchedNode
NewOrBatched returns a BatchedNode that unions two batched iterators. desc is the document traversal order for NextBatch / NextBatchGeq.
func NewOrBatchedMulti ¶ added in v0.77.0
func NewOrBatchedMulti(children []BatchedNode, desc bool) BatchedNode
func NewStaticBatched ¶ added in v0.77.0
func NewStaticBatched(data []uint32, reverse bool) BatchedNode
type LID ¶ added in v0.69.0
type LID struct {
// contains filtered or unexported fields
}
LID is an encoded representation of LID and reverse flag made specifically for fast compare operations.
For reverse order LID is inverted as follows: "MaxUint32 - LID" formula using XOR mask. Terminal LID value is 0 instead of MaxUint32 in reverse order, but 0 is XORed to MaxUint32. Which means, null value will always have lid field set to 0xFFFFFFFF (math.MaxUint32) regardless of reverse (order) flag.
func NewAscZeroLID ¶ added in v0.72.0
func NewAscZeroLID() LID
func NewDescLID ¶ added in v0.69.0
NewDescLID returns LIDs for desc sort order
func NewDescZeroLID ¶ added in v0.72.0
func NewDescZeroLID() LID
type LIDBatch ¶ added in v0.72.0
type LIDBatch interface {
Len() int
IsEmpty() bool
// Min returns minimum (first) value. Panics if batch is empty.
Min() uint32
// Max returns max (last) value. Panics if batch is empty.
Max() uint32
ManyIter(desc bool) ManyIter
// Iter iterates lids in ascending way.
Iter() Iter
// ReverseIter iterates lids in descending way.
ReverseIter() Iter
// Narrow returns a batch containing only LIDs from minLID to maxLID (inclusive both).
Narrow(minLID, maxLID uint32) LIDBatch
}
LIDBatch is batch of lids. It's immutable and can not be modified. Lids are always sorted in ascending way for every underlying implementation.
func And ¶ added in v0.77.0
And intersects two batches in the given document order and returns result and unprocessed parts (either left or right will be empty). For AND operation left and right residuals are equal to provided left or right batch, it's safe.
func AndNot ¶ added in v0.77.0
AndNot finds "AND NOT" result for two batches and returns result and unprocessed parts.
func EmptyBatch ¶ added in v0.77.0
func EmptyBatch() LIDBatch
func NewBitmapBatch ¶ added in v0.77.0
func NewBitmapBatchFromLids ¶ added in v0.77.0
func NewSliceBatch ¶ added in v0.77.0
type Node ¶
type Node interface {
fmt.Stringer // for testing
Next() LID
// NextGeq returns next greater or equal (GEQ) lid
NextGeq(nextID LID) LID
}
func BuildORTree ¶
func MakeStaticNodes ¶
MakeStaticNodes is currently used only for tests
type Sourced ¶
type Sourced interface {
fmt.Stringer // for testing
// aggregation need source
NextSourced() (id LID, source uint32)
NextSourcedGeq(nextLID LID) (id LID, source uint32)
}