Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrWrappedIndexerClosed = fmt.Errorf("Indexer closed before ready")
ErrWrappedIndexerClosed is the error returned if the indexer was closed before it was ready
Functions ¶
func DeleteRepoFromIndexer ¶
func DeleteRepoFromIndexer(repo *models.Repository, watchers ...chan<- error)
DeleteRepoFromIndexer remove all of a repository's entries from the indexer
func UpdateRepoIndexer ¶
func UpdateRepoIndexer(repo *models.Repository, watchers ...chan<- error)
UpdateRepoIndexer update a repository's entries in the indexer
Types ¶
type BleveIndexer ¶
type BleveIndexer struct {
// contains filtered or unexported fields
}
BleveIndexer represents a bleve indexer implementation
func NewBleveIndexer ¶
func NewBleveIndexer(indexDir string) (*BleveIndexer, bool, error)
NewBleveIndexer creates a new bleve local indexer
func (*BleveIndexer) Delete ¶
func (b *BleveIndexer) Delete(repoID int64) error
Delete deletes indexes by ids
func (*BleveIndexer) Index ¶
func (b *BleveIndexer) Index(repoID int64) error
Index indexes the data
func (*BleveIndexer) Search ¶
func (b *BleveIndexer) Search(repoIDs []int64, keyword string, page, pageSize int) (int64, []*SearchResult, error)
Search searches for files in the specified repo. Returns the matching file-paths
type Indexer ¶
type Indexer interface { Index(repoID int64) error Delete(repoID int64) error Search(repoIDs []int64, keyword string, page, pageSize int) (int64, []*SearchResult, error) Close() }
Indexer defines an interface to indexer issues contents
type RepoIndexerData ¶
RepoIndexerData data stored in the repo indexer
func (*RepoIndexerData) Type ¶
func (d *RepoIndexerData) Type() string
Type returns the document type, for bleve's mapping.Classifier interface.
Click to show internal directories.
Click to hide internal directories.