Documentation ¶
Index ¶
- func DeleteRepoIssueIndexer(repo *models.Repository)
- func InitIssueIndexer(syncReindex bool)
- func SearchIssuesByKeyword(repoIDs []int64, keyword string) ([]int64, error)
- func UpdateIssueIndexer(issue *models.Issue)
- func UpdateRepoIndexer(repo *models.Repository)
- type BleveIndexer
- type BleveIndexerData
- type DBIndexer
- type Indexer
- type IndexerData
- type Match
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteRepoIssueIndexer ¶
func DeleteRepoIssueIndexer(repo *models.Repository)
DeleteRepoIssueIndexer deletes repo's all issues indexes
func InitIssueIndexer ¶
func InitIssueIndexer(syncReindex bool)
InitIssueIndexer initialize issue indexer, syncReindex is true then reindex until all issue index done.
func SearchIssuesByKeyword ¶
SearchIssuesByKeyword search issue ids by keywords and repo id
func UpdateIssueIndexer ¶
UpdateIssueIndexer add/update an issue to the issue indexer
func UpdateRepoIndexer ¶
func UpdateRepoIndexer(repo *models.Repository)
UpdateRepoIndexer add/update all issues of the repositories
Types ¶
type BleveIndexer ¶
type BleveIndexer struct {
// contains filtered or unexported fields
}
BleveIndexer implements Indexer interface
func NewBleveIndexer ¶
func NewBleveIndexer(indexDir string) *BleveIndexer
NewBleveIndexer creates a new bleve local indexer
func (*BleveIndexer) Delete ¶
func (b *BleveIndexer) Delete(ids ...int64) error
Delete deletes indexes by ids
func (*BleveIndexer) Index ¶
func (b *BleveIndexer) Index(issues []*IndexerData) error
Index will save the index data
func (*BleveIndexer) Init ¶
func (b *BleveIndexer) Init() (bool, error)
Init will initial the indexer
func (*BleveIndexer) Search ¶
func (b *BleveIndexer) Search(keyword string, repoIDs []int64, limit, start int) (*SearchResult, error)
Search searches for issues by given conditions. Returns the matching issue IDs
type BleveIndexerData ¶
type BleveIndexerData IndexerData
BleveIndexerData an update to the issue indexer
func (*BleveIndexerData) Type ¶
func (i *BleveIndexerData) Type() string
Type returns the document type, for bleve's mapping.Classifier interface.
type DBIndexer ¶
type DBIndexer struct { }
DBIndexer implements Indexer interface to use database's like search
func (*DBIndexer) Index ¶
func (db *DBIndexer) Index(issue []*IndexerData) error
Index dummy function
type Indexer ¶
type Indexer interface { Init() (bool, error) Index(issue []*IndexerData) error Delete(ids ...int64) error Search(kw string, repoIDs []int64, limit, start int) (*SearchResult, error) Close() }
Indexer defines an interface to indexer issues contents
type IndexerData ¶
type IndexerData struct { ID int64 RepoID int64 Title string Content string Comments []string IsDelete bool IDs []int64 }
IndexerData data stored in the issue indexer
type SearchResult ¶
SearchResult represents search results