@@ -18,6 +18,7 @@ import (
18
18
"code.gitea.io/gitea/modules/analyze"
19
19
"code.gitea.io/gitea/modules/charset"
20
20
"code.gitea.io/gitea/modules/git"
21
+ gitea_bleve "code.gitea.io/gitea/modules/indexer/bleve"
21
22
"code.gitea.io/gitea/modules/log"
22
23
"code.gitea.io/gitea/modules/setting"
23
24
"code.gitea.io/gitea/modules/timeutil"
@@ -176,7 +177,8 @@ func NewBleveIndexer(indexDir string) (*BleveIndexer, bool, error) {
176
177
return indexer , created , err
177
178
}
178
179
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 {
180
182
// Ignore vendored files in code search
181
183
if setting .Indexer .ExcludeVendored && analyze .IsVendor (update .Filename ) {
182
184
return nil
@@ -229,7 +231,7 @@ func (b *BleveIndexer) addUpdate(batchWriter git.WriteCloserError, batchReader *
229
231
})
230
232
}
231
233
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 {
233
235
id := filenameIndexerID (repo .ID , filename )
234
236
return batch .Delete (id )
235
237
}
@@ -267,7 +269,7 @@ func (b *BleveIndexer) Close() {
267
269
268
270
// Index indexes the data
269
271
func (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 )
271
273
if len (changes .Updates ) > 0 {
272
274
273
275
batchWriter , batchReader , cancel := git .CatFileBatch (repo .RepoPath ())
@@ -296,7 +298,7 @@ func (b *BleveIndexer) Delete(repoID int64) error {
296
298
if err != nil {
297
299
return err
298
300
}
299
- batch := rupture .NewFlushingBatch (b .indexer , maxBatchSize )
301
+ batch := gitea_bleve .NewFlushingBatch (b .indexer , maxBatchSize )
300
302
for _ , hit := range result .Hits {
301
303
if err = batch .Delete (hit .ID ); err != nil {
302
304
return err
0 commit comments