search

package
v0.0.0-...-a4f0009 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: AGPL-3.0 Imports: 16 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 struct {
	// contains filtered or unexported fields
}

func NewIndex

func NewIndex(path string, detector lingua.LanguageDetector, defaultLang string) (*Index, error)

NewIndex creates or opens an index

func (*Index) Close

func (i *Index) Close() error

Close index

func (*Index) Delete

func (i *Index) Delete(roomID string) error

Delete room from index

func (*Index) Index

func (i *Index) Index(roomID string, data *model.Entry) error

Index new data

func (*Index) IndexBatch

func (i *Index) IndexBatch(batch *bleve.Batch) error

IndexBatch of entries

func (*Index) Len

func (i *Index) Len() int

Len returns size of the index (number of docs)

func (*Index) NewBatch

func (i *Index) NewBatch() *bleve.Batch

NewBatch creates new batch

func (*Index) Search

func (i *Index) Search(ctx context.Context, searchQuery query.Query, limit, offset int, sortBy []string) (results []*model.Entry, total int, err error)

Search something!

func (*Index) Swap

func (i *Index) Swap(ctx context.Context) error

Swap index

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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