indexwriter

package
v0.74.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

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