postings

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const FooterByteLength = 16

Variables

This section is empty.

Functions

This section is empty.

Types

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

func (*Footer) Write

func (f *Footer) Write(buf *bytes.Buffer)

type InvertedIndexReader

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

func NewInvertedIndexReader

func NewInvertedIndexReader(
	termDict termdict.TermDict,
	postingsFile *directory.FileSlice,
) *InvertedIndexReader

func (*InvertedIndexReader) DocFreq

func (p *InvertedIndexReader) DocFreq(term string) int

func (*InvertedIndexReader) ReadPostings

func (p *InvertedIndexReader) ReadPostings(term string) (*PostingsReader, error)

func (*InvertedIndexReader) TermDict

func (p *InvertedIndexReader) TermDict() termdict.TermDict

type InvertedIndexSerializer

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

func NewInvertedIndexSerializer

func NewInvertedIndexSerializer(segment *index.Segment) (*InvertedIndexSerializer, error)

func (*InvertedIndexSerializer) Close

func (i *InvertedIndexSerializer) Close() error

type PerFieldPostingsWriter

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

func NewMultiFieldPostingsWriter

func NewMultiFieldPostingsWriter(s *schema.Schema) *PerFieldPostingsWriter

func (*PerFieldPostingsWriter) IndexText

func (m *PerFieldPostingsWriter) IndexText(docID schema.DocID, field schema.FieldID, tokens []string)

func (*PerFieldPostingsWriter) PostingsWriterForFiled

func (m *PerFieldPostingsWriter) PostingsWriterForFiled(fieldID schema.FieldID) PostingsWriter

func (*PerFieldPostingsWriter) Serialize

func (m *PerFieldPostingsWriter) Serialize(serializer *InvertedIndexSerializer) error

type PostingsReader

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

func NewPostingsReader

func NewPostingsReader(postingsFile *directory.FileSlice) (*PostingsReader, error)

func (*PostingsReader) Advance

func (p *PostingsReader) Advance() schema.DocID

func (*PostingsReader) Doc

func (p *PostingsReader) Doc() schema.DocID

func (*PostingsReader) Seek

func (p *PostingsReader) Seek(target schema.DocID) schema.DocID

func (*PostingsReader) SizeHint

func (p *PostingsReader) SizeHint() uint32

func (*PostingsReader) TermFreq

func (p *PostingsReader) TermFreq() uint64

type PostingsWriter

type PostingsWriter interface {
	Serialize(serializer *InvertedIndexSerializer, bytesOffset int) (writtenBytes int, _ error)
	IndexText(docId schema.DocID, field schema.FieldID, tokens []string)
	AddTermFreq(term string, docID schema.DocID, termFreq uint64)
}

type SpecializedPostingsWriter

type SpecializedPostingsWriter struct {
	InvertedIndex   map[string][]schema.DocID
	TermFrequencies map[string][]uint64
	// contains filtered or unexported fields
}

func (*SpecializedPostingsWriter) AddTermFreq

func (s *SpecializedPostingsWriter) AddTermFreq(term string, docID schema.DocID, termFreq uint64)

func (*SpecializedPostingsWriter) IndexText

func (s *SpecializedPostingsWriter) IndexText(docID schema.DocID, field schema.FieldID, terms []string)

func (*SpecializedPostingsWriter) Serialize

func (s *SpecializedPostingsWriter) Serialize(serializer *InvertedIndexSerializer, bytesOffset int) (writtenBytes int, _ error)

type UnorderedTermId

type UnorderedTermId = uint64

Jump to

Keyboard shortcuts

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