From 9ff9303672755c9081d8cf528fdbfed588cc6261 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sun, 24 Mar 2024 09:42:11 +0800 Subject: [PATCH] :art: Search result content snippet returns more text https://github.com/siyuan-note/siyuan/issues/10707 --- kernel/model/search.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/model/search.go b/kernel/model/search.go index 698ea925c..3f5a69a21 100644 --- a/kernel/model/search.go +++ b/kernel/model/search.go @@ -1161,13 +1161,13 @@ func fullTextSearchByFTS(query, boxFilter, pathFilter, typeFilter, orderBy strin table = "blocks_fts_case_insensitive" } projections := "id, parent_id, root_id, hash, box, path, " + - // Improve the highlight snippet when search result content is too long https://github.com/siyuan-note/siyuan/issues/9215 - "snippet(" + table + ", 6, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "', '...', 192) AS hpath, " + - "snippet(" + table + ", 7, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "', '...', 192) AS name, " + - "snippet(" + table + ", 8, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "', '...', 192) AS alias, " + - "snippet(" + table + ", 9, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "', '...', 192) AS memo, " + + // Search result content snippet returns more text https://github.com/siyuan-note/siyuan/issues/10707 + "snippet(" + table + ", 6, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "', '...', 512) AS hpath, " + + "snippet(" + table + ", 7, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "', '...', 512) AS name, " + + "snippet(" + table + ", 8, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "', '...', 512) AS alias, " + + "snippet(" + table + ", 9, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "', '...', 512) AS memo, " + "tag, " + - "snippet(" + table + ", 11, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "', '...', 192) AS content, " + + "snippet(" + table + ", 11, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "', '...', 512) AS content, " + "fcontent, markdown, length, type, subtype, ial, sort, created, updated" stmt := "SELECT " + projections + " FROM " + table + " WHERE (`" + table + "` MATCH '" + columnFilter() + ":(" + query + ")'" stmt += ") AND type IN " + typeFilter