@@ -5,7 +5,6 @@ package repo
55
66import (
77 "bytes"
8- "fmt"
98 "maps"
109 "net/http"
1110 "slices"
@@ -34,14 +33,6 @@ import (
3433 pull_service "code.gitea.io/gitea/services/pull"
3534)
3635
37- func issueIDsFromSearch (ctx * context.Context , keyword string , opts * issues_model.IssuesOptions ) ([]int64 , error ) {
38- ids , _ , err := issue_indexer .SearchIssues (ctx , issue_indexer .ToSearchOptions (keyword , opts ))
39- if err != nil {
40- return nil , fmt .Errorf ("SearchIssues: %w" , err )
41- }
42- return ids , nil
43- }
44-
4536func retrieveProjectsForIssueList (ctx * context.Context , repo * repo_model.Repository ) {
4637 ctx .Data ["OpenProjects" ], ctx .Data ["ClosedProjects" ] = retrieveProjectsInternal (ctx , repo )
4738}
@@ -561,7 +552,7 @@ func prepareIssueFilterAndList(ctx *context.Context, milestoneID, projectID int6
561552 IssueIDs : nil ,
562553 }
563554 if keyword != "" {
564- keywordMatchedIssueIDs , err = issueIDsFromSearch (ctx , keyword , statsOpts )
555+ keywordMatchedIssueIDs , _ , err = issue_indexer . SearchIssues (ctx , issue_indexer . ToSearchOptions ( keyword , statsOpts ) )
565556 if err != nil {
566557 if issue_indexer .IsAvailable (ctx ) {
567558 ctx .ServerError ("issueIDsFromSearch" , err )
@@ -626,7 +617,7 @@ func prepareIssueFilterAndList(ctx *context.Context, milestoneID, projectID int6
626617 // Either it did search with the keyword, and found some issues, then keywordMatchedIssueIDs is not null, it needs to use db indexer.
627618 // Or the keyword is empty, it also needs to usd db indexer.
628619 // In either case, no need to use keyword anymore
629- searchResult , err := db_indexer .GetIndexer ().Search (ctx , issue_indexer . ToSearchOptions ( "" , & issues_model.IssuesOptions {
620+ searchResult , err := db_indexer .GetIndexer ().FindWithIssueOptions (ctx , & issues_model.IssuesOptions {
630621 Paginator : & db.ListOptions {
631622 Page : pager .Paginater .Current (),
632623 PageSize : setting .UI .IssuePagingNum ,
@@ -644,7 +635,7 @@ func prepareIssueFilterAndList(ctx *context.Context, milestoneID, projectID int6
644635 LabelIDs : preparedLabelFilter .SelectedLabelIDs ,
645636 SortType : sortType ,
646637 IssueIDs : keywordMatchedIssueIDs ,
647- }))
638+ })
648639 if err != nil {
649640 ctx .ServerError ("DBIndexer.Search" , err )
650641 return
0 commit comments