Documentation ¶
Index ¶
- Variables
- func CompressGob[T any](items []T) ([]byte, error)
- func CompressUint32(items []uint32) ([]byte, error)
- func CompressUint64(items []uint64) ([]byte, error)
- func DecompressGob[T any](data []byte) (items []T, err error)
- func DecompressUint32(data []byte) (items []uint32, err error)
- func DecompressUint64(data []byte) (items []uint64, err error)
- func PrintSummary(filename string, out io.Writer) error
- type InvertedIndex
- func (i *InvertedIndex[V]) Close() error
- func (i *InvertedIndex[V]) Len() int64
- func (i *InvertedIndex[V]) Put(term string, values []V) error
- func (i *InvertedIndex[V]) ReadAllValues(terms []string) (go_iterators.Iterator[V], error)
- func (i *InvertedIndex[V]) ReadTerms() (go_iterators.Iterator[string], error)
- func (i *InvertedIndex[V]) ReadValues(terms []string, minVal V, maxVal V) (go_iterators.Iterator[V], error)
- type InvertedIndexReader
- type InvertedIndexWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDuplicateTerm = fmt.Errorf("duplicate term inserted") ErrEmptyIndex = fmt.Errorf("no terms inserted") )
Functions ¶
func CompressGob ¶
func CompressUint32 ¶
func CompressUint64 ¶
func DecompressGob ¶
func DecompressUint32 ¶
func DecompressUint64 ¶
Types ¶
type InvertedIndex ¶
InvertedIndex is a single index piece consists of terms FST + sorted values for each term resembles a sorted map[string][]int NOT CONCURRENT
func (*InvertedIndex[V]) Close ¶
func (i *InvertedIndex[V]) Close() error
func (*InvertedIndex[V]) Len ¶
func (i *InvertedIndex[V]) Len() int64
func (*InvertedIndex[V]) Put ¶
func (i *InvertedIndex[V]) Put(term string, values []V) error
Put remembers all terms and its values, actual writing is delayed until Close()
func (*InvertedIndex[V]) ReadAllValues ¶
func (i *InvertedIndex[V]) ReadAllValues(terms []string) (go_iterators.Iterator[V], error)
func (*InvertedIndex[V]) ReadTerms ¶
func (i *InvertedIndex[V]) ReadTerms() (go_iterators.Iterator[string], error)
func (*InvertedIndex[V]) ReadValues ¶
func (i *InvertedIndex[V]) ReadValues(terms []string, minVal V, maxVal V) (go_iterators.Iterator[V], error)
type InvertedIndexReader ¶
type InvertedIndexReader[V constraints.Ordered] interface { // ReadTerms returns sorted iterator ReadTerms() (go_iterators.Iterator[string], error) // ReadValues returns sorted iterator ReadValues(terms []string, min V, max V) (go_iterators.Iterator[V], error) ReadAllValues(terms []string) (go_iterators.Iterator[V], error) io.Closer }
func OpenInvertedIndex ¶
func OpenInvertedIndex[V constraints.Ordered]( file string, unserializeValues func([]byte) ([]V, error), ) (InvertedIndexReader[V], error)
type InvertedIndexWriter ¶
type InvertedIndexWriter[V constraints.Ordered] interface { io.Closer // flush FST // Put must be called so terms are sorted, values must also be sorted beforehand Put(term string, values []V) error }
func NewInvertedIndexUnit ¶
func NewInvertedIndexUnit[V constraints.Ordered]( filename string, segmentSize uint32, serializeValues func([]V) ([]byte, error), unserializeValues func([]byte) ([]V, error), ) (InvertedIndexWriter[V], error)
Click to show internal directories.
Click to hide internal directories.