query

package
v0.0.0-...-ac0f108 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BooleanClause

type BooleanClause struct {
	Type MatchType
	Node Node
}

type BooleanNode

type BooleanNode struct {
	Clauses []*BooleanClause
}

func (*BooleanNode) CreateChildNode

func (n *BooleanNode) CreateChildNode(context *QueryContext) (ChildNode, error)

func (*BooleanNode) CreateRootNode

func (n *BooleanNode) CreateRootNode(context *QueryContext) (RootNode, error)

type ChildDocIterator

type ChildDocIterator interface {
	BlockMaxDocId() index.DocumentId
	BlockUpperBound() float32
	DocId() index.DocumentId
	GlobalUpperBound() float32
	IDF() float32
	Next(docId index.DocumentId) bool
	NextShallow(docId index.DocumentId) bool
	Score(documentContext *index.FieldLengthNorms) float32
}

type ChildNode

type ChildNode interface {
	CreateChildDocIterator(context *ExecutionContext, segmentIndex int) ChildDocIterator
}

type ChildTermDocIterator

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

func (*ChildTermDocIterator) BlockMaxDocId

func (t *ChildTermDocIterator) BlockMaxDocId() index.DocumentId

func (*ChildTermDocIterator) BlockUpperBound

func (t *ChildTermDocIterator) BlockUpperBound() float32

func (*ChildTermDocIterator) DocId

func (*ChildTermDocIterator) GlobalUpperBound

func (t *ChildTermDocIterator) GlobalUpperBound() float32

func (*ChildTermDocIterator) IDF

func (t *ChildTermDocIterator) IDF() float32

func (*ChildTermDocIterator) Next

func (t *ChildTermDocIterator) Next(docId index.DocumentId) bool

func (*ChildTermDocIterator) NextShallow

func (t *ChildTermDocIterator) NextShallow(docId index.DocumentId) bool

func (*ChildTermDocIterator) Score

func (t *ChildTermDocIterator) Score(fieldLengthNorms *index.FieldLengthNorms) float32

type ChildTermNode

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

func (*ChildTermNode) CreateChildDocIterator

func (t *ChildTermNode) CreateChildDocIterator(context *ExecutionContext, segmentIndex int) ChildDocIterator

type Collector

type Collector interface {
	Collect(docId uint64, score float32)
	LowerBound() float32
}

type ConjunctionRootNode

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

func (*ConjunctionRootNode) CreateRootDocIterator

func (d *ConjunctionRootNode) CreateRootDocIterator(context *ExecutionContext, segmentIndex int) RootDocIterator

type DisjunctionRootNode

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

func (*DisjunctionRootNode) CreateRootDocIterator

func (d *DisjunctionRootNode) CreateRootDocIterator(context *ExecutionContext, segmentIndex int) RootDocIterator

type DocScore

type DocScore struct {
	DocId uint64
	Score float32
}

type EmptyChildDocIterator

type EmptyChildDocIterator struct {
}

func (*EmptyChildDocIterator) DocId

func (*EmptyChildDocIterator) Next

func (e *EmptyChildDocIterator) Next(docId index.DocumentId) bool

func (*EmptyChildDocIterator) NextShallow

func (e *EmptyChildDocIterator) NextShallow(docId index.DocumentId) bool

func (*EmptyChildDocIterator) Score

func (e *EmptyChildDocIterator) Score(documentContext *index.FieldLengthNorms) float32

func (*EmptyChildDocIterator) UpperBound

func (e *EmptyChildDocIterator) UpperBound() float32

type ExecutionContext

type ExecutionContext struct {

	// FieldLengthReaders[segmentIndex][fieldIndex]
	FieldLengthReaders [][]*index.FieldLengthReader

	//PrecomputedFieldNorms[fieldIndex][lengthId]
	PrecomputedFieldNorms [][]float32
	// contains filtered or unexported fields
}

func GenerateExecutionContext

func GenerateExecutionContext(queryContext *QueryContext, segmentReaders []*index.SegmentReader) (*ExecutionContext, error)

type FieldStats

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

type Heap

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

func NewMaxHeap

func NewMaxHeap() *Heap

func NewMinHeap

func NewMinHeap() *Heap

func (*Heap) Len

func (h *Heap) Len() int

func (Heap) Less

func (h Heap) Less(i, j int) bool

func (*Heap) Pop

func (h *Heap) Pop() any

func (*Heap) Push

func (h *Heap) Push(item any)

func (Heap) Swap

func (h Heap) Swap(i, j int)

type KeyValuePair

type KeyValuePair struct {
	Key   float32
	Value interface{}
}

type MatchType

type MatchType byte
const (
	Should MatchType = iota
	Must
)

type Node

type Node interface {
	CreateRootNode(context *QueryContext) (RootNode, error)
	CreateChildNode(context *QueryContext) (ChildNode, error)
}

type QueryContext

type QueryContext struct {
	Fields []*QueryField
}

func (*QueryContext) RegisterTerm

func (c *QueryContext) RegisterTerm(fieldName string, term []byte) (int, int)

type QueryField

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

type RootConjunctionDocIterator

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

func NewConjunctionDocIterator

func NewConjunctionDocIterator(childIterators []ChildDocIterator) *RootConjunctionDocIterator

func (*RootConjunctionDocIterator) Next

func (d *RootConjunctionDocIterator) Next(fieldLengthNorms *index.FieldLengthNorms, lowerBound float32) (index.DocumentId, float32, bool)

type RootDisjunctionDocIterator

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

func NewDisjunctionDocIterator

func NewDisjunctionDocIterator(childIterators []ChildDocIterator) *RootDisjunctionDocIterator

func (*RootDisjunctionDocIterator) Next

func (d *RootDisjunctionDocIterator) Next(documentContext *index.FieldLengthNorms, lowerBound float32) (index.DocumentId, float32, bool)

Implements block-max WAND Reference: Shuai Ding and Torsten Suel. 2011. Faster top-k document retrieval using block-max indexes. In Proceedings of the 34th international ACM SIGIR conference on Research and development in Information Retrieval (SIGIR '11). Association for Computing Machinery, New York, NY, USA, 993–1002.

type RootDocIterator

type RootDocIterator interface {
	Next(documentContext *index.FieldLengthNorms, lowerBound float32) (index.DocumentId, float32, bool)
}

type RootNode

type RootNode interface {
	CreateRootDocIterator(context *ExecutionContext, segmentIndex int) RootDocIterator
}

type RootTermDocIterator

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

func (*RootTermDocIterator) Next

func (t *RootTermDocIterator) Next(fieldLengthNorms *index.FieldLengthNorms, lowerBound float32) (index.DocumentId, float32, bool)

type RootTermNode

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

func (*RootTermNode) CreateRootDocIterator

func (t *RootTermNode) CreateRootDocIterator(context *ExecutionContext, segmentIndex int) RootDocIterator

type TermNode

type TermNode struct {
	FieldName string
	Term      []byte
}

func (*TermNode) CreateChildNode

func (t *TermNode) CreateChildNode(context *QueryContext) (ChildNode, error)

func (*TermNode) CreateRootNode

func (t *TermNode) CreateRootNode(context *QueryContext) (RootNode, error)

type TopNCollector

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

func NewTopNCollector

func NewTopNCollector(topN int) *TopNCollector

func (*TopNCollector) Collect

func (c *TopNCollector) Collect(docId uint64, score float32)

func (*TopNCollector) Get

func (c *TopNCollector) Get() []*DocScore

func (*TopNCollector) LowerBound

func (c *TopNCollector) LowerBound() float32

Jump to

Keyboard shortcuts

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