forked from forgejo/forgejo
Upgrade bleve to v1.0.10 (#12737)
* Fix bug on migration 111 * Upgrade bleve to 1.0.10 Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
parent
1b9d5074a7
commit
d17efaa114
90 changed files with 12172 additions and 489 deletions
16
vendor/github.com/blevesearch/bleve/index_alias_impl.go
generated
vendored
16
vendor/github.com/blevesearch/bleve/index_alias_impl.go
generated
vendored
|
@ -16,7 +16,6 @@ package bleve
|
|||
|
||||
import (
|
||||
"context"
|
||||
"sort"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
@ -44,6 +43,16 @@ func NewIndexAlias(indexes ...Index) *indexAliasImpl {
|
|||
}
|
||||
}
|
||||
|
||||
// VisitIndexes invokes the visit callback on every
|
||||
// indexes included in the index alias.
|
||||
func (i *indexAliasImpl) VisitIndexes(visit func(Index)) {
|
||||
i.mutex.RLock()
|
||||
for _, idx := range i.indexes {
|
||||
visit(idx)
|
||||
}
|
||||
i.mutex.RUnlock()
|
||||
}
|
||||
|
||||
func (i *indexAliasImpl) isAliasToSingleIndex() error {
|
||||
if len(i.indexes) < 1 {
|
||||
return ErrorAliasEmpty
|
||||
|
@ -511,10 +520,11 @@ func MultiSearch(ctx context.Context, req *SearchRequest, indexes ...Index) (*Se
|
|||
}
|
||||
}
|
||||
|
||||
sortFunc := req.SortFunc()
|
||||
// sort all hits with the requested order
|
||||
if len(req.Sort) > 0 {
|
||||
sorter := newSearchHitSorter(req.Sort, sr.Hits)
|
||||
sort.Sort(sorter)
|
||||
sortFunc(sorter)
|
||||
}
|
||||
|
||||
// now skip over the correct From
|
||||
|
@ -539,7 +549,7 @@ func MultiSearch(ctx context.Context, req *SearchRequest, indexes ...Index) (*Se
|
|||
req.Sort.Reverse()
|
||||
// resort using the original order
|
||||
mhs := newSearchHitSorter(req.Sort, sr.Hits)
|
||||
sort.Sort(mhs)
|
||||
sortFunc(mhs)
|
||||
// reset request
|
||||
req.SearchBefore = req.SearchAfter
|
||||
req.SearchAfter = nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue