gitea/models
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
..
actions Use env GITEA_RUNNER_REGISTRATION_TOKEN as global runner token (#32946) (#32964) 2024-12-24 00:37:11 +08:00
activities Add missed auto merge feed message on dashboard (#33309) (#33405) 2025-01-26 18:57:45 +00:00
admin Fix javascript error when an anonymous user visiting migration page (#32144) 2024-10-02 04:37:16 +00:00
asymkey Use ProtonMail/go-crypto to replace keybase/go-crypto (#33402) (#33410) 2025-01-27 02:50:00 +00:00
auth Enable tenv and testifylint rules (#32852) 2024-12-15 10:41:29 +00:00
avatars Replace 10 more gt- classes with tw- (#29945) 2024-03-22 13:45:10 +00:00
db Enable tenv and testifylint rules (#32852) 2024-12-15 10:41:29 +00:00
dbfs Enable unparam linter (#31277) 2024-06-11 18:47:45 +00:00
fixtures Refactor testfixtures (#33028) 2024-12-30 02:49:49 +00:00
git Improve sync fork behavior (#33319) (#33332) 2025-01-20 07:50:38 +00:00
issues Rework suggestion backend (#33538) (#33546) 2025-02-11 01:22:39 +08:00
migrations Enable tenv and testifylint rules (#32852) 2024-12-15 10:41:29 +00:00
organization Enable tenv and testifylint rules (#32852) 2024-12-15 10:41:29 +00:00
packages Refactor maven package registry (#33049) (#33057) 2024-12-31 15:22:09 +08:00
perm Enable tenv and testifylint rules (#32852) 2024-12-15 10:41:29 +00:00
project Use project's redirect url instead of composing url (#33058) (#33064) 2024-12-31 20:06:35 +08:00
pull Add support for sha256 repositories (#23894) 2024-01-19 17:05:02 +01:00
renderhelper Refactor render system (orgmode) (#32671) 2024-11-29 16:08:29 +08:00
repo Fix missing license when sync mirror (#33255) (#33258) 2025-01-14 06:26:27 +00:00
secret Clarify Actions resources ownership (#31724) 2024-08-01 09:04:04 +00:00
shared/types Refactor locale&string&template related code (#29165) 2024-02-14 21:48:45 +00:00
system Refactor deletion (#28610) 2023-12-25 21:25:29 +01:00
unit Add DEFAULT_MIRROR_REPO_UNITS and DEFAULT_TEMPLATE_REPO_UNITS options (#32416) 2024-11-11 00:11:00 +00:00
unittest Refactor testfixtures (#33028) 2024-12-30 02:49:49 +00:00
user Fix user avatar (#33439) 2025-01-30 17:11:13 +08:00
webhook Add tests for webhook and fix some webhook bugs (#33396) (#33442) 2025-02-02 14:44:50 +08:00
error.go Add merge style fast-forward-only (#28954) 2024-02-12 23:37:23 +01:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
repo.go Fix issue comment number (#30556) (#33055) 2024-12-31 07:54:40 +08:00
repo_test.go Fix issue comment number (#30556) (#33055) 2024-12-31 07:54:40 +08:00
repo_transfer.go chore: use errors.New to replace fmt.Errorf with no parameters will much better (#30621) 2024-04-21 19:44:03 +00:00