This commit is contained in:
Daniel 2024-10-01 19:18:24 +08:00
parent f9a4dcf2a1
commit dd1bc54cac
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 15 additions and 6 deletions

View file

@ -1419,6 +1419,17 @@ func fullTextSearchCount(query, boxFilter, pathFilter, typeFilter string) (match
stmt := "SELECT COUNT(id) AS `matches`, COUNT(DISTINCT(root_id)) AS `docs` FROM `" + table + "` WHERE (`" + table + "` MATCH '" + columnFilter() + ":(" + query + ")'"
stmt += ") AND type IN " + typeFilter
stmt += boxFilter + pathFilter
if ignoreLines := getSearchIgnoreLines(); 0 < len(ignoreLines) {
// Support ignore search results https://github.com/siyuan-note/siyuan/issues/10089
buf := bytes.Buffer{}
for _, line := range ignoreLines {
buf.WriteString(" AND ")
buf.WriteString(line)
}
stmt += buf.String()
}
result, _ := sql.QueryNoLimit(stmt)
if 1 > len(result) {
return