index

package
v0.0.1-beta2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index interface {
	Put(Doc indexable) Index
	Search(terms string, engine search.Engine) entities.Iterator
}

type IndexBuilder

type IndexBuilder func(name string) Index

func NewMemoryIndexBuilder

func NewMemoryIndexBuilder(tokenizer tokenizer) IndexBuilder

type MemoryIndex

type MemoryIndex struct {
	Docs          []entities.Doc   `json:"indexed"`
	InvertedIndex map[string][]int `json:"inverted"`
	// contains filtered or unexported fields
}

func NewMemoryIndex

func NewMemoryIndex(name string, tkr tokenizer) *MemoryIndex

func (*MemoryIndex) Document

func (mi *MemoryIndex) Document(index int) entities.Doc

func (*MemoryIndex) Indexed

func (mi *MemoryIndex) Indexed(key string) (data []int)

func (*MemoryIndex) Len

func (mi *MemoryIndex) Len() int

func (*MemoryIndex) Put

func (mi *MemoryIndex) Put(payload indexable) Index

func (*MemoryIndex) Search

func (mi *MemoryIndex) Search(payload string, engine search.Engine) entities.Iterator

func (*MemoryIndex) String

func (mi *MemoryIndex) String() string

Jump to

Keyboard shortcuts

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