indexwriter

package
v0.80.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 21 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocLocation

type DocLocation = util.Pair[seq.ID, seq.DocPos]

type IndexWriter

type IndexWriter struct {
	// contains filtered or unexported fields
}

func New

func New(params common.SealParams) *IndexWriter

func (*IndexWriter) IDsTable

func (s *IndexWriter) IDsTable() seqids.Table

func (*IndexWriter) LIDsTable

func (s *IndexWriter) LIDsTable() lids.Table

func (*IndexWriter) TokenTable

func (s *IndexWriter) TokenTable() token.Table

func (*IndexWriter) WriteIDFile

func (s *IndexWriter) WriteIDFile(ws io.WriteSeeker, src Source) error

func (*IndexWriter) WriteInfoFile

func (s *IndexWriter) WriteInfoFile(ws io.Writer, src Source) error

func (*IndexWriter) WriteOffsetsFile

func (s *IndexWriter) WriteOffsetsFile(ws io.WriteSeeker, src Source) error

WriteOffsetsFile writes the .offsets file containing a single BlockOffsets block.

func (*IndexWriter) WriteTokenTriplet

func (s *IndexWriter) WriteTokenTriplet(tws, lws io.WriteSeeker, src Source) error

type Source

type Source interface {
	// Info returns metadata describing this source.
	Info() *common.Info

	// ID returns an iterator over stored document identifiers paired with
	// their positions, in descending [seq.ID] order.
	IDs() iter.Seq2[DocLocation, error]

	// BlockOffsets returns byte offsets to each document block
	// within this source's `.docs` file.
	BlockOffsets() []uint64

	// TokenTriplet iterates over fields in lexicographic order.
	// For each field, it yields tokens (lexicographically sorted)
	// paired with the local document ID list for that token.
	TokenTriplets() iter.Seq2[string, iter.Seq2[TokenLIDs, error]]
}

Source defines the data required to write all index files for a fraction.

type TokenLIDs

type TokenLIDs = util.Pair[[]byte, []uint32]

Jump to

Keyboard shortcuts

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