mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 04:17:23 +00:00
Improve search
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"github.com/gofiber/fiber/v3"
|
||||
"github.com/gofiber/fiber/v3/log"
|
||||
"net/url"
|
||||
"nysoure/server/config"
|
||||
"nysoure/server/dao"
|
||||
@@ -12,6 +10,9 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
"github.com/gofiber/fiber/v3/log"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -295,6 +296,10 @@ func SearchResource(query string, page int) ([]model.ResourceView, int, error) {
|
||||
if keyword == "" {
|
||||
continue
|
||||
}
|
||||
if utils.OnlyPunctuation(keyword) {
|
||||
continue
|
||||
}
|
||||
|
||||
res, err := searchWithKeyword(keyword)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
|
Reference in New Issue
Block a user