invertedindex

package
v0.0.0-...-f4fb894 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InvertedIndex

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

func New

func New() *InvertedIndex

func (*InvertedIndex) Get

func (index *InvertedIndex) Get(tokenId primitive.TokenId) *PostingList

func (*InvertedIndex) Insert

func (index *InvertedIndex) Insert(tokenId primitive.TokenId, value *Posting)

func (*InvertedIndex) Length

func (index *InvertedIndex) Length() int

func (*InvertedIndex) Map

func (index *InvertedIndex) Map(fn func(id primitive.TokenId, list *PostingList) error) error

func (*InvertedIndex) Push

func (index *InvertedIndex) Push(tokenId primitive.TokenId, value *Posting)

func (*InvertedIndex) Set

func (index *InvertedIndex) Set(tokenId primitive.TokenId, postingList *PostingList)

func (*InvertedIndex) TokenIds

func (index *InvertedIndex) TokenIds() []primitive.TokenId

type Posting

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

func NewPosting

func NewPosting(docId primitive.DocumentId, positions []int) *Posting

func (*Posting) DocumentId

func (p *Posting) DocumentId() primitive.DocumentId

func (*Posting) Next

func (p *Posting) Next() *Posting

func (*Posting) Positions

func (p *Posting) Positions() []int

type PostingList

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

func DecodePostingList

func DecodePostingList(blob []byte) *PostingList

func (*PostingList) CheckCorruption

func (p *PostingList) CheckCorruption() error

func (*PostingList) Count

func (p *PostingList) Count() int

func (*PostingList) Encode

func (p *PostingList) Encode(isReverse bool) []byte

func (*PostingList) Map

func (p *PostingList) Map(fn func(primitive.DocumentId, []int) error) error

func (*PostingList) Posting

func (p *PostingList) Posting() *Posting

Jump to

Keyboard shortcuts

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