1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-26 18:20:57 +00:00

[v11.0/forgejo] Update bleve to v2.5.2 with changes made in backport of 2.5.0 (#8110)

The PR contains the following changes:

- Revert the direct update to 2.5.1
- Cherry-pick the update to v2.5.0 first (containing the auto fuzzy change)
- Cherry-pick update to v2.5.2

Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8110
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
Co-committed-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
This commit is contained in:
Shiny Nematoda 2025-06-09 00:40:57 +02:00 committed by Gusted
parent f067db8f8e
commit 006d9c060e
5 changed files with 13 additions and 18 deletions

View file

@ -259,11 +259,11 @@ func (b *Indexer) Search(ctx context.Context, opts *internal.SearchOptions) (int
if opts.Mode == internal.CodeSearchModeUnion {
query := bleve.NewDisjunctionQuery()
for _, field := range strings.Fields(opts.Keyword) {
query.AddQuery(inner_bleve.MatchPhraseQuery(field, "Content", repoIndexerAnalyzer, 0))
query.AddQuery(inner_bleve.MatchPhraseQuery(field, "Content", repoIndexerAnalyzer, false))
}
keywordQuery = query
} else {
keywordQuery = inner_bleve.MatchPhraseQuery(opts.Keyword, "Content", repoIndexerAnalyzer, 0)
keywordQuery = inner_bleve.MatchPhraseQuery(opts.Keyword, "Content", repoIndexerAnalyzer, false)
}
if len(opts.RepoIDs) > 0 {