This commit is contained in:
Liang Ding 2022-09-20 11:26:53 +08:00
parent 64bea9c004
commit aaedbb2a7f
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
5 changed files with 26 additions and 4 deletions

View file

@ -81,7 +81,7 @@ func SelectSpansRawStmt(stmt string, limit int) (ret []*Span) {
}
func QueryTagSpansByKeyword(keyword string, limit int) (ret []*Span) {
stmt := "SELECT * FROM spans WHERE type = 'tag' AND content LIKE '%" + keyword + "%'"
stmt := "SELECT * FROM spans WHERE type LIKE '%tag%' AND content LIKE '%" + keyword + "%'"
stmt += " LIMIT " + strconv.Itoa(limit)
rows, err := query(stmt)
if nil != err {
@ -97,7 +97,7 @@ func QueryTagSpansByKeyword(keyword string, limit int) (ret []*Span) {
}
func QueryTagSpans(p string, limit int) (ret []*Span) {
stmt := "SELECT * FROM spans WHERE type = 'tag'"
stmt := "SELECT * FROM spans WHERE type LIKE '%tag%'"
if "" != p {
stmt += " AND path = '" + p + "'"
}