mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 04:17:23 +00:00
Enhance resource retrieval by supporting tag queries with spaces
This commit is contained in:
@@ -186,6 +186,13 @@ func Search(query string, page, pageSize int) ([]model.Resource, int, error) {
|
||||
if err == nil {
|
||||
return GetResourceByTag(tag.ID, page, pageSize)
|
||||
}
|
||||
if strings.Contains(query, " ") {
|
||||
removeSpace := strings.ReplaceAll(query, " ", "")
|
||||
tag, err = GetTagByName(removeSpace)
|
||||
if err == nil {
|
||||
return GetResourceByTag(tag.ID, page, pageSize)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
keywords := splitQuery(query)
|
||||
|
Reference in New Issue
Block a user