posting

package
v0.11.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package posting implements a posting list contains a list of document ids.

Index

Constants

This section is empty.

Variables

View Source
var ErrListEmpty = errors.New("postings list is empty")

ErrListEmpty indicates the postings list is empty.

Functions

This section is empty.

Types

type Iterator

type Iterator interface {
	Next() bool

	Current() uint64

	Close() error
}

Iterator allows iterating over a posting list.

type List

type List interface {
	Contains(id uint64) bool

	IsEmpty() bool

	Min() (uint64, error)

	Max() (uint64, error)

	Len() int

	Iterator() Iterator

	Clone() List

	Equal(other List) bool

	Insert(i uint64)

	Intersect(other List) error

	Difference(other List) error

	Union(other List) error

	UnionMany(others []List) error

	AddIterator(iter Iterator) error

	AddRange(minVal, maxVal uint64) error

	RemoveRange(minVal, maxVal uint64) error

	Reset()

	ToSlice() []uint64

	Marshall() ([]byte, error)

	Unmarshall(data []byte) error

	SizeInBytes() int64
}

List is a collection of uint64.

func Difference added in v0.11.2

func Difference(a, b List) (List, error)

Difference returns a \ b while treating empty operands as identity and protecting them against in-place mutation. The result may alias an operand (e.g. returning a when b is empty); callers must not assume the result is a private copy.

func Intersect added in v0.11.2

func Intersect(a, b List) (List, error)

Intersect returns a ∩ b while treating empty operands as identity and protecting them against in-place mutation. The result may alias an operand (e.g. returning a when a is empty); callers must not assume the result is a private copy.

func Union added in v0.11.2

func Union(a, b List) (List, error)

Union returns a ∪ b while treating empty operands as identity and protecting them against in-place mutation. The result may alias an operand (e.g. returning b when a is empty); callers must not assume the result is a private copy.

Directories

Path Synopsis
Package roaring implements the posting list by a roaring bitmap.
Package roaring implements the posting list by a roaring bitmap.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL