mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-04 23:01:16 +08:00
🎨 Return document blocks when search hits different block content https://github.com/siyuan-note/siyuan/issues/10584
This commit is contained in:
parent
91bb18203d
commit
2a7a96d772
@ -1407,7 +1407,7 @@ func fullTextSearchByFTSWithRoot(query, boxFilter, pathFilter, typeFilter, ignor
|
|||||||
wheheClause := " WHERE id IN (SELECT id FROM nonDocBlocks) OR id IN (SELECT root_id FROM docBlocks)"
|
wheheClause := " WHERE id IN (SELECT id FROM nonDocBlocks) OR id IN (SELECT root_id FROM docBlocks)"
|
||||||
selectStmt := cteStmt + "\nSELECT * FROM " + table + wheheClause
|
selectStmt := cteStmt + "\nSELECT * FROM " + table + wheheClause
|
||||||
countStmt := cteStmt + "\nSELECT COUNT(id) AS `matches`, COUNT(DISTINCT(root_id)) AS `docs` FROM " + table + wheheClause
|
countStmt := cteStmt + "\nSELECT COUNT(id) AS `matches`, COUNT(DISTINCT(root_id)) AS `docs` FROM " + table + wheheClause
|
||||||
cteStmt += orderBy + " LIMIT " + strconv.Itoa(pageSize) + " OFFSET " + strconv.Itoa((page-1)*pageSize)
|
selectStmt += orderBy + " LIMIT " + strconv.Itoa(pageSize) + " OFFSET " + strconv.Itoa((page-1)*pageSize)
|
||||||
resultBlocks := sql.SelectBlocksRawStmtNoParse(selectStmt, -1)
|
resultBlocks := sql.SelectBlocksRawStmtNoParse(selectStmt, -1)
|
||||||
|
|
||||||
logging.LogInfof("time cost [main search]: %v", time.Since(start))
|
logging.LogInfof("time cost [main search]: %v", time.Since(start))
|
||||||
|
Loading…
Reference in New Issue
Block a user