Browse Source

Merge remote-tracking branch 'origin/dev' into dev

Vanessa 2 years ago
parent
commit
4b3e18f46e

+ 2 - 2
app/appearance/langs/en_US.json

@@ -457,7 +457,7 @@
   "keymapTip2": "Use default shortcut keys",
   "searchLimit": "The number of search results displayed",
   "searchLimit1": "If the amount of data is large, do not configure the value too large, the default is <code class='fn__code'>64</code>",
-  "searchLimit2": "This configuration item affects all functions related to search, such as: search, file history, query embed block, tab panel and template function queryBlocks/querySpans",
+  "searchLimit2": "This configuration item affects all functions related to searches, such as block ref search, file history, query embed block, tab panel, and template function queryBlocks/querySpans",
   "searchCaseSensitive": "Case Sensitive",
   "searchCaseSensitive1": "After enabling, all search-related functions will be case sensitive",
   "toggleWin": "Hide/Show Window",
@@ -1035,7 +1035,7 @@
     "119": "Downloading web image [%s]",
     "120": "Download complete, [%d] files total",
     "121": "There is no network image in this document",
-    "122": "This function needs to be configured on SiYuan desktop",
+    "122": "This function needs to be configured on the SiYuan desktop. If you have already configured it, please refresh it in the top account settings",
     "123": "The synchronization function can only be activated after adding/selecting the cloud synchronization directory",
     "124": "Please enable cloud sync in [Settings - Enable Cloud Sync]",
     "125": "Auto sync failed too many times, please try to manually trigger sync, if there is still a problem, please report it via <a href=\"https://github.com/siyuan-note/siyuan/issues\" target=\"_blank\">GitHub Issues</a>",

+ 2 - 2
app/appearance/langs/es_ES.json

@@ -457,7 +457,7 @@
   "keymapTip2": "Usar teclas de acceso directo por defecto",
   "searchLimit": "El número de resultados de búsqueda mostrados",
   "searchLimit1": "Si la cantidad de datos es grande, no configure el valor demasiado grande, el valor por defecto es <code class='fn__code'>64</code>",
-  "searchLimit2": "Este elemento de configuración afecta a todas las funciones relacionadas con la búsqueda, como: búsqueda, historial de archivos, bloque de incrustación de consulta, panel de pestañas y función de plantilla queryBlocks/querySpans",
+  "searchLimit2": "Este elemento de configuración afecta a todas las funciones relacionadas con las búsquedas, como la búsqueda de referencias de bloques, el historial de archivos, el bloque de incrustación de consultas, el panel de pestañas y la función de plantilla queryBlocks/querySpans",
   "searchCaseSensitive": "Distingue mayúsculas y minúsculas",
   "searchCaseSensitive1": "Después de habilitarlo, todas las funciones relacionadas con la búsqueda distinguirán entre mayúsculas y minúsculas",
   "toggleWin": "Ocultar/Mostrar Ventana",
@@ -1035,7 +1035,7 @@
     "119": "Descargando imagen web [%s]",
     "120": "Descarga completa, [%d] archivos en total",
     "121": "No hay ninguna imagen de red en este documento",
-    "122": "Esta función necesita ser configurada en el escritorio de SiYuan",
+    "122": "Esta funci\u00f3n debe configurarse en el escritorio de SiYuan. Si ya la configur\u00f3, actualice en la configuraci\u00f3n de la cuenta superior",
     "123": "La función de sincronización solo puede activarse después de añadir/seleccionar el directorio de sincronización en la nube",
     "124": "Por favor, active la sincronización en la nube en [Configuración - Activar sincronización en la nube]",
     "125": "La sincronización automática ha fallado demasiadas veces, por favor intente activar la sincronización manualmente, si todavía hay un problema, por favor infórmelo a través de <a href=\"https://github.com/siyuan-note/siyuan/issues\" target=\"_blank\">Problemas GitHub</a>",

+ 2 - 2
app/appearance/langs/fr_FR.json

@@ -456,7 +456,7 @@
   "keymapTip2": "Utiliser les touches de raccourci par défaut",
   "searchLimit": "Le nombre de résultats de recherche affichés",
   "searchLimit1": "Si la quantité de données est importante, ne configurez pas la valeur trop grande, la valeur par défaut est <code class='fn__code'>64</code>",
-  "searchLimit2": "Cet élément de configuration affecte toutes les fonctions liées à la recherche, telles que : la recherche, l'historique des fichiers, le bloc d'intégration de requête, le panneau d'onglets et la fonction de modèle queryBlocks/querySpans",
+  "searchLimit2": "Cet élément de configuration affecte toutes les fonctions liées aux recherches, telles que la recherche de référence de bloc, l'historique des fichiers, le bloc d'intégration de requête, le panneau d'onglets et la fonction de modèle queryBlocks/querySpans",
   "searchCaseSensitive": "Sensible à la casse",
   "searchCaseSensitive1": "Après l'activation, toutes les fonctions liées à la recherche seront sensibles à la casse.",
   "toggleWin": "Masquer/afficher fenêtres",
@@ -1034,7 +1034,7 @@
     "119": "Téléchargement de l'image Web [%s]",
     "120": "Téléchargement terminé, [%d] fichiers au total",
     "121": "Il n'y a pas d'image réseau dans ce document",
-    "122": "Cette fonction doit être configurée sur le bureau SiYuan",
+    "122": "Cette fonction doit être configurée sur le bureau SiYuan. Si vous l'avez déjà configurée, veuillez l'actualiser dans les paramètres supérieurs du compte",
     "123": "Ajouter/sélectionner un répertoire de synchronisation Cloud avant d'activer la synchronisation",
     "124": "Veuillez activer la synchronisation cloud dans [Paramètres - Activer la synchronisation cloud]",
     "125": "Il y a trop d'échecs de téléchargement dans la synchronisation automatique. Veuillez essayer de déclencher manuellement la synchronisation. Si le problème persiste, veuillez le signaler via <a href=\"https://github.com/siyuan-note/siyuan/issues\" target=\"_blank\">GitHub Issues</a>",

+ 2 - 2
app/appearance/langs/zh_CHT.json

@@ -457,7 +457,7 @@
   "keymapTip2": "使用預設快捷鍵",
   "searchLimit": "搜索結果顯示數",
   "searchLimit1": "如果資料量較大,該值請勿配置過大,預設為 <code class='fn__code'>64</code>",
-  "searchLimit2": "該配置項影響所有涉及搜索的功能,例如:搜索、文件歷史、查詢嵌入塊、標籤面板和模板函數 queryBlocks/querySpans",
+  "searchLimit2": "該配置項影響所有涉及搜索的功能,例如:塊引搜索、文件歷史、查詢嵌入塊、標籤面板和模板函數 queryBlocks/querySpans",
   "searchCaseSensitive": "區分大小寫",
   "searchCaseSensitive1": "啟用後所有搜索相關功能將區分大小寫",
   "toggleWin": "隱藏/顯示視窗",
@@ -1034,7 +1034,7 @@
     "118": "當前設置不允許在 7 層深度的文檔下創建子文檔",
     "119": "正在下載網絡圖片 [%s]",
     "120": "下載完畢,一共 [%d] 個文件",
-    "122": "該功能需在思源桌面端進行配置",
+    "122": "該功能需在思源桌面端進行配置。如果你已經配置,請在頂部賬號設置中進行刷新",
     "121": "該文檔中不存在網絡圖片",
     "123": "新增/選擇雲端同步目錄後才能啟用同步功能",
     "124": "請在 [設置 - 啟用雲端同步] 中開啟雲端同步",

+ 2 - 3
app/appearance/langs/zh_CN.json

@@ -457,7 +457,7 @@
   "keymapTip2": "使用默认快捷键",
   "searchLimit": "搜索结果显示数",
   "searchLimit1": "如果数据量较大,该值请勿配置过大,默认为 <code class='fn__code'>64</code>",
-  "searchLimit2": "该配置项影响所有涉及搜索的功能,例如:搜索、文件历史、查询嵌入块、标签面板和模板函数 queryBlocks/querySpans",
+  "searchLimit2": "该配置项影响所有涉及搜索的功能,例如:块引搜索、文件历史、查询嵌入块、标签面板和模板函数 queryBlocks/querySpans",
   "searchCaseSensitive": "区分大小写",
   "searchCaseSensitive1": "启用后所有搜索相关功能将区分大小写",
   "toggleWin": "隐藏/显示窗口",
@@ -913,7 +913,6 @@
     "quit": "退出程序"
   },
   "_performance": {
-
   },
   "_kernel": {
     "0": "查询笔记本失败",
@@ -1038,7 +1037,7 @@
     "119": "正在下载网络图片 [%s]",
     "120": "下载完毕,一共 [%d] 个文件",
     "121": "该文档中不存在网络图片",
-    "122": "该功能需在思源桌面端进行配置",
+    "122": "该功能需在思源桌面端进行配置。如果你已经配置,请在顶部账号设置中进行刷新",
     "123": "添加/选择云端同步目录后才能启用同步功能",
     "124": "请在 [设置 - 启用云端同步] 中开启云端同步",
     "125": "自动同步下载失败次数过多,请尝试手动触发同步,如果还有问题请<a href=\"https://ld246.com/article/1649901726096\" target=\"_blank\">反馈</a>",

+ 1 - 2
kernel/api/search.go

@@ -267,12 +267,11 @@ func fullTextSearchBlock(c *gin.Context) {
 	if nil != groupByArg {
 		groupBy = int(groupByArg.(float64))
 	}
-	blocks, matchedBlockCount, matchedRootCount, pageCount, totalCount := model.FullTextSearchBlock(query, boxes, paths, types, method, orderBy, groupBy, page)
+	blocks, matchedBlockCount, matchedRootCount, pageCount := model.FullTextSearchBlock(query, boxes, paths, types, method, orderBy, groupBy, page)
 	ret.Data = map[string]interface{}{
 		"blocks":            blocks,
 		"matchedBlockCount": matchedBlockCount,
 		"matchedRootCount":  matchedRootCount,
 		"pageCount":         pageCount,
-		"totalCount":        totalCount,
 	}
 }

+ 2 - 1
kernel/model/search.go

@@ -397,7 +397,7 @@ const pageSize = 32
 // method:0:关键字,1:查询语法,2:SQL,3:正则表达式
 // orderBy: 0:按块类型(默认),1:按创建时间升序,2:按创建时间降序,3:按更新时间升序,4:按更新时间降序,5:按内容顺序(仅在按文档分组时),6:按相关度升序,7:按相关度降序
 // groupBy:0:不分组,1:按文档分组
-func FullTextSearchBlock(query string, boxes, paths []string, types map[string]bool, method, orderBy, groupBy, page int) (ret []*Block, matchedBlockCount, matchedRootCount, pageCount, totalCount int) {
+func FullTextSearchBlock(query string, boxes, paths []string, types map[string]bool, method, orderBy, groupBy, page int) (ret []*Block, matchedBlockCount, matchedRootCount, pageCount int) {
 	query = strings.TrimSpace(query)
 	beforeLen := 36
 	var blocks []*Block
@@ -421,6 +421,7 @@ func FullTextSearchBlock(query string, boxes, paths []string, types map[string]b
 		pathFilter := buildPathsFilter(paths)
 		blocks, matchedBlockCount, matchedRootCount = fullTextSearchByKeyword(query, boxFilter, pathFilter, filter, orderByClause, beforeLen, page)
 	}
+	pageCount = (matchedBlockCount + pageSize - 1) / pageSize
 
 	switch groupBy {
 	case 0: // 不分组