mirror of https://gitee.com/answerdev/answer.git
fix(search): direct search of main tag content when searching for synonym tags
This commit is contained in:
parent
2ffcf2bf4b
commit
9fded40c3d
|
@ -2,6 +2,7 @@ package search_parser
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/answerdev/answer/internal/base/constant"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
@ -105,7 +106,11 @@ func (sp *SearchParser) parseTags(ctx context.Context, query *string) (tags []st
|
|||
if err != nil || !exists {
|
||||
continue
|
||||
}
|
||||
tags = append(tags, tag.ID)
|
||||
if tag.MainTagID > 0 {
|
||||
tags = append(tags, fmt.Sprintf("%d", tag.MainTagID))
|
||||
} else {
|
||||
tags = append(tags, tag.ID)
|
||||
}
|
||||
}
|
||||
|
||||
// limit maximum 5 tags
|
||||
|
|
Loading…
Reference in New Issue