You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/models/issues
Giteabot a014d071e4
Rework suggestion backend (#33538) (#33546)
Backport #33538 by @lunny

Fix #33522 

The suggestion backend logic now is

- If the keyword is empty, returned the latest 5 issues/prs with index
desc order
- If the keyword is digital, find all issues/prs which `index` has a
prefix with that, with index asc order
- If the keyword is non-digital or if the queried records less than 5,
searching issues/prs title with a `like`, with index desc order

## Empty keyword
<img width="310" alt="image"
src="https://github.com/user-attachments/assets/1912c634-0d98-4eeb-8542-d54240901f77"
/>

## Digital
<img width="479" alt="image"
src="https://github.com/user-attachments/assets/0356a936-7110-4a24-b21e-7400201bf9b8"
/>

## Digital and title contains the digital
<img width="363" alt="image"
src="https://github.com/user-attachments/assets/6e12f908-28fe-48de-8ccc-09cbeab024d4"
/>

## non-Digital
<img width="435" alt="image"
src="https://github.com/user-attachments/assets/2722bb53-baa2-4d67-a224-522a65f73856"
/>
<img width="477" alt="image"
src="https://github.com/user-attachments/assets/06708dd9-80d1-4a88-b32b-d29072dd1ba6"
/>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 weeks ago
..
assignees.go Performance improvements for pull request list API (#30490) 9 months ago
assignees_test.go Remove deadcode under models/issues (#28536) 1 year ago
comment.go Fix issue comment number (#30556) (#33055) 2 months ago
comment_code.go Refactor markup render system (#32612) 3 months ago
comment_list.go Only update poster in issue/comment list if it has been loaded (#31216) 9 months ago
comment_test.go Fix issue comment number (#30556) (#33055) 2 months ago
content_history.go Fix issue & comment history bugs (#29525) 12 months ago
content_history_test.go Fix issue & comment history bugs (#29525) 12 months ago
dependency.go Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
dependency_test.go Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
issue.go Rework suggestion backend (#33538) (#33546) 2 weeks ago
issue_index.go Update golangci-lint to v1.62.2, fix issues (#32845) 2 months ago
issue_label.go Performance improvements for pull request list API (#30490) 9 months ago
issue_label_test.go Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
issue_list.go Add issue comment when moving issues from one column to another of the project (#29311) 7 months ago
issue_list_test.go Add context parameter to some database functions (#26055) 2 years ago
issue_lock.go Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
issue_project.go Fix unnecessary comment when moving issue on the same project column (#33496) (#33499) 2 weeks ago
issue_search.go Add label/author/assignee filters to the user/org home issue list (#32779) 2 months ago
issue_stats.go Add label/author/assignee filters to the user/org home issue list (#32779) 2 months ago
issue_test.go Enable tenv and testifylint rules (#32852) 2 months ago
issue_update.go Trim title before insert/update to database to match the size requirements of database (#32498) 3 months ago
issue_user.go Add combined index for issue_user.uid and issue_id (#28080) 1 year ago
issue_user_test.go Fix bug with sqlite load read (#26305) 2 years ago
issue_watch.go Strict pagination check (#32548) 3 months ago
issue_watch_test.go Enable tenv and testifylint rules (#32852) 2 months ago
issue_xref.go Add user blocking (#29028) 12 months ago
issue_xref_test.go Resolve lint for unused parameter and unnecessary type arguments (#30750) 10 months ago
label.go Support org labels when adding labels by label names (#32988) (#32996) 2 months ago
label_test.go Enable tenv and testifylint rules (#32852) 2 months ago
main_test.go make writing main test easier (#27270) 1 year ago
milestone.go Fix milestone deadline and date related problems (#32339) 4 months ago
milestone_list.go Added default sorting milestones by name (#27084) 7 months ago
milestone_test.go Enable tenv and testifylint rules (#32852) 2 months ago
pull.go Filter reviews of one pull request in memory instead of database to reduce slow response because of lacking database index (#33106) (#33128) 2 months ago
pull_list.go Use batch database operations instead of one by one to optimze api pulls (#32680) 2 months ago
pull_list_test.go Enable tenv and testifylint rules (#32852) 2 months ago
pull_test.go Enable tenv and testifylint rules (#32852) 2 months ago
reaction.go Strict pagination check (#32548) 3 months ago
review.go Fix issue comment number (#30556) (#33055) 2 months ago
review_list.go Filter reviews of one pull request in memory instead of database to reduce slow response because of lacking database index (#33106) (#33128) 2 months ago
review_test.go Filter reviews of one pull request in memory instead of database to reduce slow response because of lacking database index (#33106) (#33128) 2 months ago
stopwatch.go Make tracked time representation display as hours (#33315) (#33334) 1 month ago
stopwatch_test.go Enable tenv and testifylint rules (#32852) 2 months ago
tracked_time.go Strict pagination check (#32548) 3 months ago
tracked_time_test.go Enable tenv and testifylint rules (#32852) 2 months ago