Merge branch 'fix/1.1.3/qa' into test

This commit is contained in:
LinkinStars 2023-08-31 14:16:41 +08:00
commit d170680e7d
1 changed files with 6 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package search_parser
import (
"context"
"fmt"
"github.com/answerdev/answer/internal/base/constant"
"regexp"
"strings"
@ -105,8 +106,12 @@ func (sp *SearchParser) parseTags(ctx context.Context, query *string) (tags []st
if err != nil || !exists {
continue
}
if tag.MainTagID > 0 {
tags = append(tags, fmt.Sprintf("%d", tag.MainTagID))
} else {
tags = append(tags, tag.ID)
}
}
// limit maximum 5 tags
if len(tags) > limit {