terms

package
v1.27.7 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocPointerWithScore

type DocPointerWithScore struct {
	Id uint64
	// A Frequency of 0 indicates a tombstone
	Frequency  float32
	PropLength float32
}

func (*DocPointerWithScore) FromBytes

func (d *DocPointerWithScore) FromBytes(in []byte, isTombstone bool, boost float32) error

func (*DocPointerWithScore) FromKeyVal

func (d *DocPointerWithScore) FromKeyVal(key []byte, value []byte, isTombstone bool, boost float32) error

type SortedDocPointerWithScoreMerger

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

func NewSortedDocPointerWithScoreMerger

func NewSortedDocPointerWithScoreMerger() *SortedDocPointerWithScoreMerger

func (*SortedDocPointerWithScoreMerger) Do

type Term

type Term struct {
	// doubles as max impact (with tf=1, the max impact would be 1*Idf), if there
	// is a boost for a queryTerm, simply apply it here once
	Idf float64

	IdPointer      uint64
	PosPointer     uint64
	Data           []DocPointerWithScore
	Exhausted      bool
	QueryTerm      string
	QueryTermIndex int
}

func (*Term) AdvanceAtLeast

func (t *Term) AdvanceAtLeast(minID uint64)

func (*Term) Count

func (t *Term) Count() int

func (*Term) ScoreAndAdvance

func (t *Term) ScoreAndAdvance(averagePropLength float64, config schema.BM25Config) (uint64, float64, DocPointerWithScore)

type Terms

type Terms struct {
	T     []*Term
	Count int
}

func (*Terms) AdvanceAllAtLeast

func (t *Terms) AdvanceAllAtLeast(minID uint64)

func (*Terms) CompletelyExhausted

func (t *Terms) CompletelyExhausted() bool

func (*Terms) FindFirstNonExhausted

func (t *Terms) FindFirstNonExhausted() (int, bool)

func (*Terms) FindMinID

func (t *Terms) FindMinID(minScore float64) (uint64, int, bool)

func (*Terms) FullSort

func (t *Terms) FullSort()

func (*Terms) Len

func (t *Terms) Len() int

provide sort interface

func (*Terms) Less

func (t *Terms) Less(i, j int) bool

func (*Terms) PartialSort

func (t *Terms) PartialSort()

func (*Terms) Pivot

func (t *Terms) Pivot(minScore float64) bool

func (*Terms) ScoreNext

func (t *Terms) ScoreNext(averagePropLength float64, config schema.BM25Config, additionalExplanations bool) (uint64, float64, []*DocPointerWithScore)

func (*Terms) Swap

func (t *Terms) Swap(i, j int)

Jump to

Keyboard shortcuts

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