mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-18 16:24:07 +00:00
fix(indexer): correct bleve indexer token filters (#38853)
* fix #36228 * fix #37221 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -7,13 +7,13 @@ import (
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"gitea.dev/modules/util"
|
||||
|
||||
"github.com/blevesearch/bleve/v2/analysis"
|
||||
"github.com/blevesearch/bleve/v2/registry"
|
||||
)
|
||||
|
||||
const (
|
||||
Name = "gitea/path"
|
||||
)
|
||||
const Name = "gitea/path"
|
||||
|
||||
type TokenFilter struct{}
|
||||
|
||||
@@ -98,8 +98,5 @@ func generatePathTokens(input analysis.TokenStream, reversed bool) analysis.Toke
|
||||
|
||||
func init() {
|
||||
// FIXME: move it to the bleve's init function, but do not call it in global init
|
||||
err := registry.RegisterTokenFilter(Name, TokenFilterConstructor)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
util.MustNoError(registry.RegisterTokenFilter(Name, TokenFilterConstructor))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user