blugeindex

package
v0.0.0-...-50b11ce Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: BSD-2-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidIndexPath = errors.New("invalid index path")
View Source
var ErrLevelDBOpen = errors.New("failed to open the ID database")
View Source
var ErrOfflineIndex = errors.New("offline indexer, operation not supported")

Functions

func NewFilenameAnalyzer

func NewFilenameAnalyzer() *analysis.Analyzer

func NewFilenameTokenizer

func NewFilenameTokenizer() *tokenizer.CharacterTokenizer

Types

type BlugeIndex

type BlugeIndex struct {
	IndexPath string
	BatchSize uint
	// contains filtered or unexported fields
}

func NewBlugeIndex

func NewBlugeIndex(indexPath string, batchSize uint) (*BlugeIndex, error)

func OfflineIndex

func OfflineIndex(indexPath string) (*BlugeIndex, error)

Can be used from a different process

func (*BlugeIndex) Close

func (i *BlugeIndex) Close()

func (*BlugeIndex) Count

func (i *BlugeIndex) Count() (uint64, error)

func (*BlugeIndex) Has

func (i *BlugeIndex) Has(fileID string) (bool, error)

func (*BlugeIndex) Index

func (i *BlugeIndex) Index(docs chan Indexable) chan DocumentIndexed

func (*BlugeIndex) Search

func (i *BlugeIndex) Search(q string, fn func(search.DocumentMatchIterator) error) error

func (*BlugeIndex) SetBatchSize

func (i *BlugeIndex) SetBatchSize(size uint)

type DocumentBuilder

type DocumentBuilder interface {
	// BuildDocument returns a new Bluge document to be indexed.
	// The Restic node (file or directory) to be index is passed as an argument so third
	// party implementation can decide the node information they want indexed.
	BuildDocument(string, *restic.Node, *repository.Repository) *bluge.Document
}

DocumentBuilder is the interface custom indexers should implement.

type DocumentIndexed

type DocumentIndexed struct {
	Document *bluge.Document
	Error    error
}

type FileDocumentBuilder

type FileDocumentBuilder struct{}

func (FileDocumentBuilder) BuildDocument

func (i FileDocumentBuilder) BuildDocument(fileID string, node *restic.Node, repo *repository.Repository) *bluge.Document

type Indexable

type Indexable struct {
	Document *bluge.Document
	Path     string
}

type IndexedDocument

type IndexedDocument struct {
	Document *bluge.Document
	Path     string
	Error    error
}

Jump to

Keyboard shortcuts

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