mirror of https://gitee.com/answerdev/answer.git
Merge branch 'feat/backyard-search' into 'main'
Feat/backyard search See merge request opensource/answer!152
This commit is contained in:
commit
aa9ba8a3f6
|
@ -234,9 +234,9 @@ func (ar *answerRepo) CmsSearchList(ctx context.Context, search *entity.CmsAnswe
|
|||
id = ""
|
||||
)
|
||||
|
||||
if strings.Contains(search.Query, "id:") {
|
||||
if strings.Contains(search.Query, "answer:") {
|
||||
idSearch = true
|
||||
id = strings.TrimSpace(strings.TrimPrefix(search.Query, "id:"))
|
||||
id = strings.TrimSpace(strings.TrimPrefix(search.Query, "answer:"))
|
||||
for _, r := range id {
|
||||
if !unicode.IsDigit(r) {
|
||||
idSearch = false
|
||||
|
|
|
@ -256,9 +256,9 @@ func (qr *questionRepo) CmsSearchList(ctx context.Context, search *schema.CmsQue
|
|||
idSearch = false
|
||||
id = ""
|
||||
)
|
||||
if strings.Contains(search.Query, "id:") {
|
||||
if strings.Contains(search.Query, "question:") {
|
||||
idSearch = true
|
||||
id = strings.TrimSpace(strings.TrimPrefix(search.Query, "id:"))
|
||||
id = strings.TrimSpace(strings.TrimPrefix(search.Query, "question:"))
|
||||
for _, r := range id {
|
||||
if !unicode.IsDigit(r) {
|
||||
idSearch = false
|
||||
|
|
|
@ -95,9 +95,9 @@ func (ur *userBackyardRepo) GetUserPage(ctx context.Context, page, pageSize int,
|
|||
id = ""
|
||||
)
|
||||
|
||||
if strings.Contains(query, "id:") {
|
||||
if strings.Contains(query, "user:") {
|
||||
idSearch = true
|
||||
id = strings.TrimSpace(strings.TrimPrefix(query, "id:"))
|
||||
id = strings.TrimSpace(strings.TrimPrefix(query, "user:"))
|
||||
for _, r := range id {
|
||||
if !unicode.IsDigit(r) {
|
||||
idSearch = false
|
||||
|
|
Loading…
Reference in New Issue