mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Support elastic search for code search (#10273)
* Support elastic search for code search * Finished elastic search implementation and add some tests * Enable test on drone and added docs * Add new fields to elastic search * Fix bug * remove unused changes * Use indexer alias to keep the gitea indexer version * Improve codes * Some code improvements * The real indexer name changed to xxx.v1 Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
		@@ -7,6 +7,8 @@ package code
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"sync"
 | 
			
		||||
 | 
			
		||||
	"code.gitea.io/gitea/models"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
@@ -55,12 +57,12 @@ func (w *wrappedIndexer) get() (Indexer, error) {
 | 
			
		||||
	return w.internal, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (w *wrappedIndexer) Index(repoID int64) error {
 | 
			
		||||
func (w *wrappedIndexer) Index(repo *models.Repository, sha string, changes *repoChanges) error {
 | 
			
		||||
	indexer, err := w.get()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	return indexer.Index(repoID)
 | 
			
		||||
	return indexer.Index(repo, sha, changes)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (w *wrappedIndexer) Delete(repoID int64) error {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user