Documentation ¶
Index ¶
- Variables
- func NewFilenameAnalyzer() *analysis.Analyzer
- func NewFilenameTokenizer() *tokenizer.CharacterTokenizer
- type BlugeIndex
- func (i *BlugeIndex) Close()
- func (i *BlugeIndex) Count() (uint64, error)
- func (i *BlugeIndex) Has(fileID string) (bool, error)
- func (i *BlugeIndex) Index(docs chan Indexable) chan DocumentIndexed
- func (i *BlugeIndex) Search(q string, fn func(search.DocumentMatchIterator) error) error
- func (i *BlugeIndex) SetBatchSize(size uint)
- type DocumentBuilder
- type DocumentIndexed
- type FileDocumentBuilder
- type Indexable
- type IndexedDocument
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 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) 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 FileDocumentBuilder ¶
type FileDocumentBuilder struct{}
func (FileDocumentBuilder) BuildDocument ¶
func (i FileDocumentBuilder) BuildDocument(fileID string, node *restic.Node, repo *repository.Repository) *bluge.Document
Click to show internal directories.
Click to hide internal directories.