mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-02 04:42:21 +00:00
enh(search): improve issue search
- new sort by relevency option for issue search - rework bleve fuzzy search to consider each term rather than matching the entire phrase
This commit is contained in:
parent
c8ba330833
commit
a265574821
10 changed files with 56 additions and 31 deletions
|
@ -208,12 +208,18 @@ func (b *Indexer) Search(ctx context.Context, options *internal.SearchOptions) (
|
|||
query.And(inner_meilisearch.NewFilterLte("updated_unix", options.UpdatedBeforeUnix.Value()))
|
||||
}
|
||||
|
||||
if options.SortBy == "" {
|
||||
options.SortBy = internal.SortByCreatedAsc
|
||||
}
|
||||
sortBy := []string{
|
||||
parseSortBy(options.SortBy),
|
||||
"id:desc",
|
||||
var sortBy []string
|
||||
switch options.SortBy {
|
||||
// sort by relevancy (no explicit sorting)
|
||||
case internal.SortByScore:
|
||||
fallthrough
|
||||
case "":
|
||||
sortBy = []string{}
|
||||
default:
|
||||
sortBy = []string{
|
||||
parseSortBy(options.SortBy),
|
||||
"id:desc",
|
||||
}
|
||||
}
|
||||
|
||||
skip, limit := indexer_internal.ParsePaginator(options.Paginator, maxTotalHits)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue