gitea/services/issue
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>
2025-02-11 01:22:39 +08:00
..
assignee.go Fix get reviewers' bug (#32415) 2024-11-22 10:44:48 -05:00
assignee_test.go Performance improvements for pull request list API (#30490) 2024-05-31 12:10:11 +00:00
comments.go Prevent simultaneous editing of comments and issues (#31053) 2024-05-27 15:34:18 +00:00
commit.go Enable more `revive` linter rules (#30608) 2024-04-22 11:48:42 +00:00
commit_test.go Replace 'userxx' with 'orgxx' in all test files when the user type is org (#27052) 2023-09-14 02:59:53 +00:00
content.go Prevent simultaneous editing of comments and issues (#31053) 2024-05-27 15:34:18 +00:00
issue.go Issue time estimate, meaningful time tracking (#23113) 2024-12-05 13:07:53 +00:00
issue_test.go Penultimate round of `db.DefaultContext` refactor (#27414) 2023-10-11 04:24:07 +00:00
label.go Penultimate round of `db.DefaultContext` refactor (#27414) 2023-10-11 04:24:07 +00:00
label_test.go Next round of `db.DefaultContext` refactor (#27089) 2023-09-16 14:39:12 +00:00
main_test.go Move AddCollabrator and CreateRepositoryByExample to service layer (#32419) 2024-11-07 11:28:11 +08:00
milestone.go demilestone should not include milestone (#32923) (#32979) 2024-12-25 08:03:18 +00:00
milestone_test.go demilestone should not include milestone (#32923) (#32979) 2024-12-25 08:03:18 +00:00
pull.go Update misspell to 0.5.1 and add `misspellings.csv` (#30573) 2024-04-27 08:03:49 +00:00
reaction.go Add user blocking (#29028) 2024-03-04 08:16:03 +00:00
reaction_test.go Add user blocking (#29028) 2024-03-04 08:16:03 +00:00
status.go Fix 500 error when `state` params is set when editing issue/PR by API (#31880) 2024-09-02 02:08:27 +08:00
suggestion.go Rework suggestion backend (#33538) (#33546) 2025-02-11 01:22:39 +08:00
suggestion_test.go Rework suggestion backend (#33538) (#33546) 2025-02-11 01:22:39 +08:00
template.go refactor: remove redundant err declarations (#32381) 2024-10-30 19:36:24 +00:00