fix(indexer): correct bleve indexer token filters (#38853) (#38951)

Backport #38853 by @gomitrah

* fix #36228
* fix #37221

Co-authored-by: Mitrahsoft <bala.c@mitrahsoft.in>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Giteabot
2026-08-17 10:51:24 -07:00
committed by GitHub
parent cbcf36cded
commit 1c3ae57f35
9 changed files with 246 additions and 17 deletions
@@ -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))
}