{"modulePath":"github.com/RedAFD/code-core","version":"v1.8.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package indexer\n\n## Constants\n\n```go\nconst (\n\t// RepoIndexerOpUpdate add/update a file's contents\n\tRepoIndexerOpUpdate = iota\n\n\t// RepoIndexerOpDelete delete a file\n\tRepoIndexerOpDelete\n)\n```\n\n## Functions\n\n```go\nfunc DeleteRepoFromIndexer(repoID int64) error\n```\nDeleteRepoFromIndexer delete all of a repo's files from indexer\n\n```go\nfunc InitRepoIndexer(populateIndexer func() error)\n```\nInitRepoIndexer initialize repo indexer\n\n```go\nfunc RepoIndexerBatch() rupture.FlushingBatch\n```\nRepoIndexerBatch batch to add updates to\n\n## Types\n\n```go\ntype RepoIndexerData struct {\n\tRepoID  int64\n\tContent string\n}\n```\nRepoIndexerData data stored in the repo indexer\n\n```go\nfunc (d *RepoIndexerData) Type() string\n```\nType returns the document type, for bleve's mapping.Classifier interface.\n\n```go\ntype RepoIndexerOp int\n```\nRepoIndexerOp type of operation to perform on repo indexer\n\n```go\ntype RepoIndexerUpdate struct {\n\tFilepath string\n\tOp       RepoIndexerOp\n\tData     *RepoIndexerData\n}\n```\nRepoIndexerUpdate an update to the repo indexer\n\n```go\nfunc (update RepoIndexerUpdate) AddToFlushingBatch(batch rupture.FlushingBatch) error\n```\nAddToFlushingBatch adds the update to the given flushing batch.\n\n```go\ntype RepoSearchResult struct {\n\tRepoID     int64\n\tStartIndex int\n\tEndIndex   int\n\tFilename   string\n\tContent    string\n}\n```\nRepoSearchResult result of performing a search in a repo\n\n```go\nfunc SearchRepoByKeyword(repoIDs []int64, keyword string, page, pageSize int) (int64, []*RepoSearchResult, error)\n```\nSearchRepoByKeyword searches for files in the specified repo. Returns the matching file-paths\n\n","path":"github.com/RedAFD/code-core/modules/indexer","name":"indexer","synopsis":"","isRedistributable":true}
