@@ -18,6 +18,7 @@ import (
1818 "code.gitea.io/gitea/modules/analyze"
1919 "code.gitea.io/gitea/modules/charset"
2020 "code.gitea.io/gitea/modules/git"
21+ gitea_bleve "code.gitea.io/gitea/modules/indexer/bleve"
2122 "code.gitea.io/gitea/modules/log"
2223 "code.gitea.io/gitea/modules/setting"
2324 "code.gitea.io/gitea/modules/timeutil"
@@ -176,7 +177,8 @@ func NewBleveIndexer(indexDir string) (*BleveIndexer, bool, error) {
176177 return indexer , created , err
177178}
178179
179- func (b * BleveIndexer ) addUpdate (batchWriter git.WriteCloserError , batchReader * bufio.Reader , commitSha string , update fileUpdate , repo * models.Repository , batch rupture.FlushingBatch ) error {
180+ func (b * BleveIndexer ) addUpdate (batchWriter git.WriteCloserError , batchReader * bufio.Reader , commitSha string ,
181+ update fileUpdate , repo * models.Repository , batch * gitea_bleve.FlushingBatch ) error {
180182 // Ignore vendored files in code search
181183 if setting .Indexer .ExcludeVendored && analyze .IsVendor (update .Filename ) {
182184 return nil
@@ -229,7 +231,7 @@ func (b *BleveIndexer) addUpdate(batchWriter git.WriteCloserError, batchReader *
229231 })
230232}
231233
232- func (b * BleveIndexer ) addDelete (filename string , repo * models.Repository , batch rupture .FlushingBatch ) error {
234+ func (b * BleveIndexer ) addDelete (filename string , repo * models.Repository , batch * gitea_bleve .FlushingBatch ) error {
233235 id := filenameIndexerID (repo .ID , filename )
234236 return batch .Delete (id )
235237}
@@ -267,7 +269,7 @@ func (b *BleveIndexer) Close() {
267269
268270// Index indexes the data
269271func (b * BleveIndexer ) Index (repo * models.Repository , sha string , changes * repoChanges ) error {
270- batch := rupture .NewFlushingBatch (b .indexer , maxBatchSize )
272+ batch := gitea_bleve .NewFlushingBatch (b .indexer , maxBatchSize )
271273 if len (changes .Updates ) > 0 {
272274
273275 batchWriter , batchReader , cancel := git .CatFileBatch (repo .RepoPath ())
@@ -296,7 +298,7 @@ func (b *BleveIndexer) Delete(repoID int64) error {
296298 if err != nil {
297299 return err
298300 }
299- batch := rupture .NewFlushingBatch (b .indexer , maxBatchSize )
301+ batch := gitea_bleve .NewFlushingBatch (b .indexer , maxBatchSize )
300302 for _ , hit := range result .Hits {
301303 if err = batch .Delete (hit .ID ); err != nil {
302304 return err
0 commit comments