1
0
Fork 0
forked from forgejo/forgejo

Sort issue search results by revelance (#14353)

This commit is contained in:
Lauris BH 2021-01-16 06:55:17 +02:00 committed by GitHub
parent 2db4733c7d
commit 0a3c3357f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 5 deletions

View file

@ -247,6 +247,7 @@ func (b *BleveIndexer) Search(keyword string, repoIDs []int64, limit, start int)
newMatchPhraseQuery(keyword, "Comments", issueIndexerAnalyzer),
))
search := bleve.NewSearchRequestOptions(indexerQuery, limit, start, false)
search.SortBy([]string{"-_score"})
result, err := b.indexer.Search(search)
if err != nil {