Skip to content

Commit

Permalink
🎨 Return document blocks when search hits different block content #10584
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Oct 24, 2024
1 parent 91bb182 commit 2a7a96d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/model/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
selectStmt := cteStmt + "\nSELECT * 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)

logging.LogInfof("time cost [main search]: %v", time.Since(start))
Expand Down

0 comments on commit 2a7a96d

Please sign in to comment.