gitea: code.gitea.io/gitea/modules/indexer/issues Index | Files

package issues

import "code.gitea.io/gitea/modules/indexer/issues"

Index

Package Files

bleve.go db.go indexer.go queue.go queue_channel.go queue_disk.go queue_redis.go

func DeleteRepoIssueIndexer Uses

func DeleteRepoIssueIndexer(repo *models.Repository)

DeleteRepoIssueIndexer deletes repo's all issues indexes

func InitIssueIndexer Uses

func InitIssueIndexer(syncReindex bool) error

InitIssueIndexer initialize issue indexer, syncReindex is true then reindex until all issue index done.

func SearchIssuesByKeyword Uses

func SearchIssuesByKeyword(repoID int64, keyword string) ([]int64, error)

SearchIssuesByKeyword search issue ids by keywords and repo id

func UpdateIssueIndexer Uses

func UpdateIssueIndexer(issue *models.Issue)

UpdateIssueIndexer add/update an issue to the issue indexer

type BleveIndexer Uses

type BleveIndexer struct {
    // contains filtered or unexported fields
}

BleveIndexer implements Indexer interface

func NewBleveIndexer Uses

func NewBleveIndexer(indexDir string) *BleveIndexer

NewBleveIndexer creates a new bleve local indexer

func (*BleveIndexer) Delete Uses

func (b *BleveIndexer) Delete(ids ...int64) error

Delete deletes indexes by ids

func (*BleveIndexer) Index Uses

func (b *BleveIndexer) Index(issues []*IndexerData) error

Index will save the index data

func (*BleveIndexer) Init Uses

func (b *BleveIndexer) Init() (bool, error)

Init will initial the indexer

func (*BleveIndexer) Search Uses

func (b *BleveIndexer) Search(keyword string, repoID int64, limit, start int) (*SearchResult, error)

Search searches for issues by given conditions. Returns the matching issue IDs

type BleveIndexerData Uses

type BleveIndexerData IndexerData

BleveIndexerData an update to the issue indexer

func (*BleveIndexerData) Type Uses

func (i *BleveIndexerData) Type() string

Type returns the document type, for bleve's mapping.Classifier interface.

type ChannelQueue Uses

type ChannelQueue struct {
    // contains filtered or unexported fields
}

ChannelQueue implements

func NewChannelQueue Uses

func NewChannelQueue(indexer Indexer, batchNumber int) *ChannelQueue

NewChannelQueue create a memory channel queue

func (*ChannelQueue) Push Uses

func (c *ChannelQueue) Push(data *IndexerData) error

Push will push the indexer data to queue

func (*ChannelQueue) Run Uses

func (c *ChannelQueue) Run() error

Run starts to run the queue

type DBIndexer Uses

type DBIndexer struct {
}

DBIndexer implements Indexer inteface to use database's like search

func (*DBIndexer) Delete Uses

func (db *DBIndexer) Delete(ids ...int64) error

Delete dummy function

func (*DBIndexer) Index Uses

func (db *DBIndexer) Index(issue []*IndexerData) error

Index dummy function

func (*DBIndexer) Init Uses

func (db *DBIndexer) Init() (bool, error)

Init dummy function

func (*DBIndexer) Search Uses

func (db *DBIndexer) Search(kw string, repoID int64, limit, start int) (*SearchResult, error)

Search dummy function

type DummyQueue Uses

type DummyQueue struct {
}

DummyQueue represents an empty queue

func (*DummyQueue) Push Uses

func (b *DummyQueue) Push(*IndexerData) error

Push pushes data to indexer

func (*DummyQueue) Run Uses

func (b *DummyQueue) Run() error

Run starts to run the queue

type Indexer Uses

type Indexer interface {
    Init() (bool, error)
    Index(issue []*IndexerData) error
    Delete(ids ...int64) error
    Search(kw string, repoID int64, limit, start int) (*SearchResult, error)
}

Indexer defines an inteface to indexer issues contents

type IndexerData Uses

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 LevelQueue Uses

type LevelQueue struct {
    // contains filtered or unexported fields
}

LevelQueue implements a disk library queue

func NewLevelQueue Uses

func NewLevelQueue(indexer Indexer, dataDir string, batchNumber int) (*LevelQueue, error)

NewLevelQueue creates a ledis local queue

func (*LevelQueue) Push Uses

func (l *LevelQueue) Push(data *IndexerData) error

Push will push the indexer data to queue

func (*LevelQueue) Run Uses

func (l *LevelQueue) Run() error

Run starts to run the queue

type Match Uses

type Match struct {
    ID     int64   `json:"id"`
    RepoID int64   `json:"repo_id"`
    Score  float64 `json:"score"`
}

Match represents on search result

type Queue Uses

type Queue interface {
    Run() error
    Push(*IndexerData) error
}

Queue defines an interface to save an issue indexer queue

type RedisQueue Uses

type RedisQueue struct {
    // contains filtered or unexported fields
}

RedisQueue redis queue

func NewRedisQueue Uses

func NewRedisQueue(addrs string, password string, dbIdx int, indexer Indexer, batchNumber int) (*RedisQueue, error)

NewRedisQueue creates single redis or cluster redis queue

func (*RedisQueue) Push Uses

func (r *RedisQueue) Push(data *IndexerData) error

Push implements Queue

func (*RedisQueue) Run Uses

func (r *RedisQueue) Run() error

Run runs the redis queue

type SearchResult Uses

type SearchResult struct {
    Total int64
    Hits  []Match
}

SearchResult represents search results

Package issues imports 22 packages (graph) and is imported by 8 packages. Updated 2019-08-26. Refresh now. Tools for package owners.