summaryrefslogtreecommitdiffstats
path: root/modules/indexer/code/bleve.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2022-01-20 18:46:10 +0100
committerGitHub <noreply@github.com>2022-01-20 18:46:10 +0100
commit54e9ee37a7a301dbe74d46fd3c87712e6120e9bf (patch)
tree1be12fb072625c1b896b9d72f7912b018aad502b /modules/indexer/code/bleve.go
parent1d98d205f5825f40110e6628b61a97c91ac7f72d (diff)
downloadgitea-54e9ee37a7a301dbe74d46fd3c87712e6120e9bf.tar.gz
gitea-54e9ee37a7a301dbe74d46fd3c87712e6120e9bf.zip
format with gofumpt (#18184)
* gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
Diffstat (limited to 'modules/indexer/code/bleve.go')
-rw-r--r--modules/indexer/code/bleve.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/indexer/code/bleve.go b/modules/indexer/code/bleve.go
index 64e974dc18..cfadcfebd8 100644
--- a/modules/indexer/code/bleve.go
+++ b/modules/indexer/code/bleve.go
@@ -38,8 +38,10 @@ import (
"github.com/go-enry/go-enry/v2"
)
-const unicodeNormalizeName = "unicodeNormalize"
-const maxBatchSize = 16
+const (
+ unicodeNormalizeName = "unicodeNormalize"
+ maxBatchSize = 16
+)
// numericEqualityQuery a numeric equality query for the given value and field
func numericEqualityQuery(value int64, field string) *query.NumericRangeQuery {
@@ -158,9 +160,7 @@ func createBleveIndexer(path string, latestVersion int) (bleve.Index, error) {
return indexer, nil
}
-var (
- _ Indexer = &BleveIndexer{}
-)
+var _ Indexer = &BleveIndexer{}
// BleveIndexer represents a bleve indexer implementation
type BleveIndexer struct {
@@ -337,7 +337,7 @@ func (b *BleveIndexer) Search(repoIDs []int64, language, keyword string, page, p
}
if len(repoIDs) > 0 {
- var repoQueries = make([]query.Query, 0, len(repoIDs))
+ repoQueries := make([]query.Query, 0, len(repoIDs))
for _, repoID := range repoIDs {
repoQueries = append(repoQueries, numericEqualityQuery(repoID, "RepoID"))
}