Skip to content

Commit 9fded40

Browse files
committed
fix(search): direct search of main tag content when searching for synonym tags
1 parent 2ffcf2b commit 9fded40

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

internal/service/search_parser/search_parser.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package search_parser
22

33
import (
44
"context"
5+
"fmt"
56
"github.com/answerdev/answer/internal/base/constant"
67
"regexp"
78
"strings"
@@ -105,7 +106,11 @@ func (sp *SearchParser) parseTags(ctx context.Context, query *string) (tags []st
105106
if err != nil || !exists {
106107
continue
107108
}
108-
tags = append(tags, tag.ID)
109+
if tag.MainTagID > 0 {
110+
tags = append(tags, fmt.Sprintf("%d", tag.MainTagID))
111+
} else {
112+
tags = append(tags, tag.ID)
113+
}
109114
}
110115

111116
// limit maximum 5 tags

0 commit comments

Comments
 (0)