reverseindex

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: GPL-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntersectionOfSkipList

func IntersectionOfSkipList(lists ...*skiplist.SkipList) (res *skiplist.SkipList)

func UnionOfSkipList

func UnionOfSkipList(lists ...*skiplist.SkipList) (res *skiplist.SkipList)

Types

type IReverseIndex

type IReverseIndex interface {
	// TODO: 将接收的Document转换成指针类型,并修改其他调用改接口的地方
	// 添加一个Document
	Add(doc types.Document)

	// 删除Keyword对应的Document
	Delete(IntId uint64, keyword *types.Keyword)

	// 搜索,返回文档ID列表
	Search(q *types.TermQuery, onFlag uint64, offFlag uint64, orFlags []uint64) []string
}

type SkipListReverseIndex

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

倒排索引整体上是个Map,key是关键词KeyWord,value是倒排索引的列表(跳表实现)

func NewSkipListReverseIndex

func NewSkipListReverseIndex(DocNumEstimate int) *SkipListReverseIndex

DocNumEstimate 预估的文档数量

func (SkipListReverseIndex) Add

func (idx SkipListReverseIndex) Add(doc types.Document)

func (SkipListReverseIndex) Delete

func (idx SkipListReverseIndex) Delete(IntId uint64, keyword *types.Keyword)

func (SkipListReverseIndex) FilterByBits

func (idx SkipListReverseIndex) FilterByBits(bits uint64, onFlag uint64, offFlag uint64, orFlags []uint64) bool

func (SkipListReverseIndex) Search

func (idx SkipListReverseIndex) Search(tq *types.TermQuery, onFlag, offFlag uint64, orFlags []uint64) []string

type SkipListValue

type SkipListValue struct {
	Id          string
	BitsFeature uint64
}

Jump to

Keyboard shortcuts

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