An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Disable unsupported search controls by method https://github.com/siyuan-note/siyuan/issues/20338
Danielea0f1bab9b4f
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.jsonindex 75e1170e6a..fb254599aa 100644--- a/app/appearance/langs/ar.json+++ b/app/appearance/langs/ar.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "هذا الخيار غير متاح لطريقة البحث الحالية","selectCoordinateSystem": "اختر نظام الإحداثيات","coordinateOrder": "ترتيب الإحداثيات","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.jsonindex 1306133ed4..fba7c34bac 100644--- a/app/appearance/langs/de.json+++ b/app/appearance/langs/de.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "Für die aktuelle Suchmethode nicht verfügbar","selectCoordinateSystem": "Koordinatensystem auswählen","coordinateOrder": "Koordinatenreihenfolge","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.jsonindex b11dac7195..e1b463befb 100644--- a/app/appearance/langs/en.json+++ b/app/appearance/langs/en.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "Unavailable for the current search method","selectCoordinateSystem": "Select a coordinate system","coordinateOrder": "Coordinate order","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.jsonindex 65292b5e6a..9b388fa4a4 100644--- a/app/appearance/langs/es.json+++ b/app/appearance/langs/es.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "No disponible para el método de búsqueda actual","selectCoordinateSystem": "Seleccione un sistema de coordenadas","coordinateOrder": "Orden de las coordenadas","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.jsonindex 9ee6195761..26d71588a0 100644--- a/app/appearance/langs/fr.json+++ b/app/appearance/langs/fr.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "Indisponible pour la méthode de recherche actuelle","selectCoordinateSystem": "Sélectionnez un système de coordonnées","coordinateOrder": "Ordre des coordonnées","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.jsonindex 5934cf19a0..26815ade84 100644--- a/app/appearance/langs/he.json+++ b/app/appearance/langs/he.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "האפשרות אינה זמינה בשיטת החיפוש הנוכחית","selectCoordinateSystem": "בחרו מערכת קואורדינטות","coordinateOrder": "סדר הקואורדינטות","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.jsonindex 379997a9f8..fa080d7587 100644--- a/app/appearance/langs/hi.json+++ b/app/appearance/langs/hi.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "वर्तमान खोज विधि में यह विकल्प उपलब्ध नहीं है","selectCoordinateSystem": "निर्देशांक प्रणाली चुनें","coordinateOrder": "निर्देशांक क्रम","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.jsonindex 20a0f9b62d..386ccbcb6d 100644--- a/app/appearance/langs/id.json+++ b/app/appearance/langs/id.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "Tidak tersedia untuk metode pencarian saat ini","selectCoordinateSystem": "Pilih sistem koordinat","coordinateOrder": "Urutan koordinat","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.jsonindex 33393c7956..0b2df8b0d5 100644--- a/app/appearance/langs/it.json+++ b/app/appearance/langs/it.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "Non disponibile per il metodo di ricerca corrente","selectCoordinateSystem": "Seleziona un sistema di coordinate","coordinateOrder": "Ordine delle coordinate","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.jsonindex 3f7a7a6c73..3a785a6714 100644--- a/app/appearance/langs/ja.json+++ b/app/appearance/langs/ja.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "現在の検索方法ではこの項目を利用できません","selectCoordinateSystem": "座標系を選択してください","coordinateOrder": "座標の順序","coordinateSystemWGS84": "WGS84(OpenFreeMap)",diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.jsonindex 1bda0452e5..8801b635a7 100644--- a/app/appearance/langs/ko.json+++ b/app/appearance/langs/ko.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "현재 검색 방식에서는 이 옵션을 사용할 수 없습니다","selectCoordinateSystem": "좌표계를 선택하세요","coordinateOrder": "좌표 순서","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.jsonindex 3d6920b6a2..d5cd596cb7 100644--- a/app/appearance/langs/nl.json+++ b/app/appearance/langs/nl.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "Niet beschikbaar voor de huidige zoekmethode","selectCoordinateSystem": "Selecteer een coördinatenstelsel","coordinateOrder": "Coördinatenvolgorde","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.jsonindex f4ee166376..737a12c4a1 100644--- a/app/appearance/langs/pl.json+++ b/app/appearance/langs/pl.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "Niedostępne dla bieżącej metody wyszukiwania","selectCoordinateSystem": "Wybierz układ współrzędnych","coordinateOrder": "Kolejność współrzędnych","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.jsonindex 507a1760e1..d3661d9413 100644--- a/app/appearance/langs/pt-BR.json+++ b/app/appearance/langs/pt-BR.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "Indisponível para o método de pesquisa atual","selectCoordinateSystem": "Selecione um sistema de coordenadas","coordinateOrder": "Ordem das coordenadas","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.jsonindex 83bde4bf50..08c5644733 100644--- a/app/appearance/langs/ru.json+++ b/app/appearance/langs/ru.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "Недоступно для текущего метода поиска","selectCoordinateSystem": "Выберите систему координат","coordinateOrder": "Порядок координат","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.jsonindex a5077eaa3a..b383b6d355 100644--- a/app/appearance/langs/sk.json+++ b/app/appearance/langs/sk.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "Nie je dostupné pre aktuálnu metódu vyhľadávania","selectCoordinateSystem": "Vyberte súradnicový systém","coordinateOrder": "Poradie súradníc","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.jsonindex fda946cecf..7d10778642 100644--- a/app/appearance/langs/sr.json+++ b/app/appearance/langs/sr.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "Није доступно за тренутни начин претраге","selectCoordinateSystem": "Изаберите координатни систем","coordinateOrder": "Редослед координата","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.jsonindex 6143e6d8b2..5749231676 100644--- a/app/appearance/langs/th.json+++ b/app/appearance/langs/th.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "ตัวเลือกนี้ไม่พร้อมใช้งานสำหรับวิธีค้นหาปัจจุบัน","selectCoordinateSystem": "โปรดเลือกระบบพิกัด","coordinateOrder": "ลำดับพิกัด","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.jsonindex 74b6ac413c..e44d2e7e04 100644--- a/app/appearance/langs/tr.json+++ b/app/appearance/langs/tr.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "Geçerli arama yöntemi için kullanılamaz","selectCoordinateSystem": "Bir koordinat sistemi seçin","coordinateOrder": "Koordinat sırası","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.jsonindex f145f407e4..c9e42f90cc 100644--- a/app/appearance/langs/uk.json+++ b/app/appearance/langs/uk.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "Недоступно для поточного методу пошуку","selectCoordinateSystem": "Виберіть систему координат","coordinateOrder": "Порядок координат","coordinateSystemWGS84": "WGS84 (OpenFreeMap)",diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.jsonindex 38f68b9935..19f4a1a7b3 100644--- a/app/appearance/langs/zh-CN.json+++ b/app/appearance/langs/zh-CN.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "当前搜索方式不支持此选项","selectCoordinateSystem": "请选择坐标系","coordinateOrder": "坐标顺序","coordinateSystemWGS84": "WGS84(OpenFreeMap)",diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.jsonindex ea32f87f88..af538cd7c2 100644--- a/app/appearance/langs/zh-TW.json+++ b/app/appearance/langs/zh-TW.json@@ -1,4 +1,5 @@{+ "searchControlUnavailable": "目前的搜尋方式不支援此選項","selectCoordinateSystem": "請選擇座標系","coordinateOrder": "座標順序","coordinateSystemWGS84": "WGS84(OpenFreeMap)",diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-l3qg72k.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-l3qg72k.syindex c2e6f60f89..82096e8921 100644--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-l3qg72k.sy+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-l3qg72k.sy@@ -7,7 +7,7 @@"id": "20210808180303-l3qg72k","title": "Advanced search","type": "doc",- "updated": "20260929000700"+ "updated": "20261009182324"},"Children": [{@@ -39,6 +39,91 @@}]},+ {+ "ID": "20261009182324-t1r641c",+ "Type": "NodeHeading",+ "Properties": {+ "id": "20261009182324-t1r641c",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "Controls by search method"+ }+ ],+ "HeadingLevel": 2+ },+ {+ "ID": "20261009182324-1ulhib3",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-1ulhib3",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "Keyword and query syntax searches support block-type, notebook and document-path filters, including child documents, as well as sorting, grouping and replacement. Content-order sorting is available only when grouping by document."+ }+ ]+ },+ {+ "ID": "20261009182324-49vls9t",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-49vls9t",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "Regular expression search supports the same filters, grouping and replacement, plus type, creation-time and update-time sorting. Relevance sorting is unavailable; content-order sorting applies only within document groups."+ }+ ]+ },+ {+ "ID": "20261009182324-5ryxgkw",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-5ryxgkw",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "SQL search uses the filters and result order written in the SQL statement. The panel's block-type and path filters, including the current-document scope and child-document option, do not apply. Replacement is unavailable. Grouping by document remains available; in grouped results, type, creation-time, update-time and content-order sorting remain available, but relevance sorting does not apply."+ }+ ]+ },+ {+ "ID": "20261009182324-seagl6e",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-seagl6e",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "Semantic search supports block-type, notebook and document-path filters, including child documents. Results follow semantic relevance; panel sorting, grouping and replacement are unavailable."+ }+ ]+ },+ {+ "ID": "20261009182324-87b7poz",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-87b7poz",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "Controls that do not apply to the selected method are disabled with an explanatory tooltip. SQL and semantic search hide the replacement row while keeping its text and expanded state, which are restored when returning to a method that supports replacement. Saving and resetting query conditions remain available."+ }+ ]+ },{"ID": "20260929000700-l9atr7g","Type": "NodeHeading",@@ -577,4 +662,4 @@]}]-}\ No newline at end of file+}diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-gyngv2x.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-gyngv2x.syindex 00983a47f7..49afe54c7b 100644--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-gyngv2x.sy+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-gyngv2x.sy@@ -7,7 +7,7 @@"id": "20210808180320-gyngv2x","title": "搜索进阶","type": "doc",- "updated": "20260929000700"+ "updated": "20261009182324"},"Children": [{@@ -39,6 +39,91 @@}]},+ {+ "ID": "20261009182324-ljls7op",+ "Type": "NodeHeading",+ "Properties": {+ "id": "20261009182324-ljls7op",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "各搜索方式的控件范围"+ }+ ],+ "HeadingLevel": 2+ },+ {+ "ID": "20261009182324-wscenpu",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-wscenpu",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "关键字与查询语法搜索支持块类型、笔记本和文档路径筛选、包含子文档,以及排序、分组和替换。按内容顺序排序仅在按文档分组时可用。"+ }+ ]+ },+ {+ "ID": "20261009182324-4yld8po",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-4yld8po",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "正则搜索支持相同的筛选、分组和替换,以及按类型、创建时间和更新时间排序。不支持按相关度排序;按内容顺序仅用于文档分组内的结果。"+ }+ ]+ },+ {+ "ID": "20261009182324-i0gjmmp",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-i0gjmmp",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "SQL 搜索使用语句中指定的筛选条件和结果顺序。面板中的块类型、路径筛选,包括当前文档范围与包含子文档选项,不会生效,也不支持替换。仍可按文档分组;分组后可按类型、创建时间、更新时间与内容顺序整理结果,但不支持按相关度排序。"+ }+ ]+ },+ {+ "ID": "20261009182324-mayn7w7",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-mayn7w7",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "语义搜索支持块类型、笔记本和文档路径筛选,以及包含子文档。结果按语义相关性排列,不支持面板中的排序、分组和替换。"+ }+ ]+ },+ {+ "ID": "20261009182324-o78o1c9",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-o78o1c9",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "当前搜索方式不支持的控件会禁用并显示说明提示。SQL 与语义搜索会隐藏替换输入行,但保留已输入文本和展开状态,切回支持替换的方式时恢复显示。保存和重置查询条件仍可使用。"+ }+ ]+ },{"ID": "20260929000700-huot6nw","Type": "NodeHeading",@@ -577,4 +662,4 @@]}]-}\ No newline at end of file+}diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120933-vnjgwwh.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120933-vnjgwwh.syindex d37fdb2b67..7495cf2547 100644--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120933-vnjgwwh.sy+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120933-vnjgwwh.sy@@ -7,7 +7,7 @@"id": "20211226120933-vnjgwwh","title": "搜索進階","type": "doc",- "updated": "20260929000700"+ "updated": "20261009182324"},"Children": [{@@ -39,6 +39,91 @@}]},+ {+ "ID": "20261009182324-g42svwc",+ "Type": "NodeHeading",+ "Properties": {+ "id": "20261009182324-g42svwc",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "各搜尋方式的控制項範圍"+ }+ ],+ "HeadingLevel": 2+ },+ {+ "ID": "20261009182324-g6i7omp",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-g6i7omp",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "關鍵字與查詢語法搜尋支援區塊類型、筆記本和文件路徑篩選、包含子文件,以及排序、分組和取代。依內容順序排序僅在依文件分組時可用。"+ }+ ]+ },+ {+ "ID": "20261009182324-ugt9zh5",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-ugt9zh5",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "正規表示式搜尋支援相同的篩選、分組和取代,以及依類型、建立時間和更新時間排序。不支援依相關度排序;依內容順序僅用於文件分組內的結果。"+ }+ ]+ },+ {+ "ID": "20261009182324-rfoi2nj",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-rfoi2nj",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "SQL 搜尋使用語句中指定的篩選條件和結果順序。面板中的區塊類型、路徑篩選,包括目前文件範圍與包含子文件選項,不會生效,也不支援取代。仍可依文件分組;分組後可依類型、建立時間、更新時間與內容順序整理結果,但不支援依相關度排序。"+ }+ ]+ },+ {+ "ID": "20261009182324-7v8lo26",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-7v8lo26",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "語意搜尋支援區塊類型、筆記本和文件路徑篩選,以及包含子文件。結果依語意相關性排列,不支援面板中的排序、分組和取代。"+ }+ ]+ },+ {+ "ID": "20261009182324-vejc0gc",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-vejc0gc",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "目前搜尋方式不支援的控制項會停用並顯示說明提示。SQL 與語意搜尋會隱藏取代輸入列,但保留已輸入文字和展開狀態,切回支援取代的方式時恢復顯示。儲存和重設查詢條件仍可使用。"+ }+ ]+ },{"ID": "20260929000700-1t67phl","Type": "NodeHeading",@@ -577,4 +662,4 @@]}]-}\ No newline at end of file+}diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-a91lmk2.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-a91lmk2.syindex 92d4087d80..3b5070c956 100644--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-a91lmk2.sy+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-a91lmk2.sy@@ -8,7 +8,7 @@"id": "20240530101000-a91lmk2","title": "高度な検索","type": "doc",- "updated": "20260929000700"+ "updated": "20261009182324"},"Children": [{@@ -40,6 +40,91 @@}]},+ {+ "ID": "20261009182324-svc2r56",+ "Type": "NodeHeading",+ "Properties": {+ "id": "20261009182324-svc2r56",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "検索方法ごとに利用できる操作"+ }+ ],+ "HeadingLevel": 2+ },+ {+ "ID": "20261009182324-duyze6a",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-duyze6a",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "キーワード検索とクエリ構文検索では、ブロックタイプ、ノートブック、文書パス、子文書を含めるかどうかの絞り込みと、並べ替え、グループ化、置換を利用できます。本文の順序による並べ替えは、文書ごとにグループ化した場合のみ利用できます。"+ }+ ]+ },+ {+ "ID": "20261009182324-n7t8cwa",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-n7t8cwa",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "正規表現検索では、同じ絞り込み、グループ化、置換と、タイプ、作成日時、更新日時による並べ替えを利用できます。関連度による並べ替えは利用できません。本文の順序は文書グループ内の結果にのみ適用されます。"+ }+ ]+ },+ {+ "ID": "20261009182324-k4vtj63",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-k4vtj63",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "SQL 検索では、SQL 文に記述した条件と順序を使用します。パネルのブロックタイプ、パス、現在の文書の範囲、子文書を含める設定は適用されず、置換も利用できません。文書ごとのグループ化は利用でき、グループ化後の結果はタイプ、作成日時、更新日時、本文の順序で並べ替えられますが、関連度では並べ替えられません。"+ }+ ]+ },+ {+ "ID": "20261009182324-5i14ow7",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-5i14ow7",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "意味検索では、ブロックタイプ、ノートブック、文書パス、子文書を含めるかどうかの絞り込みを利用できます。結果は意味の関連度順に表示され、パネルの並べ替え、グループ化、置換は利用できません。"+ }+ ]+ },+ {+ "ID": "20261009182324-imw0dl2",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261009182324-imw0dl2",+ "updated": "20261009182324"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "現在の検索方法で利用できない操作は無効になり、説明が表示されます。SQL 検索と意味検索では置換入力行が非表示になりますが、入力内容と展開状態は保持され、置換を利用できる方法に戻すと再表示されます。検索条件の保存とリセットは引き続き利用できます。"+ }+ ]+ },{"ID": "20260929000700-6p02njw","Type": "NodeHeading",@@ -571,4 +656,4 @@]}]-}\ No newline at end of file+}diff --git a/app/src/assets/scss/component/_chip.scss b/app/src/assets/scss/component/_chip.scssindex 156445c662..79aa399262 100644--- a/app/src/assets/scss/component/_chip.scss+++ b/app/src/assets/scss/component/_chip.scss@@ -129,11 +129,16 @@flex-shrink: 0;padding: 2px;- &:hover {+ &:hover:not([disabled]) {// 不明原因 https://github.com/siyuan-note/siyuan/issues/7756#issuecomment-1484057954opacity: .99;background-color: var(--b3-list-icon-hover);}++ &[disabled] {+ opacity: .38;+ cursor: not-allowed;+ }}&--middle {diff --git a/app/src/assets/scss/component/_form.scss b/app/src/assets/scss/component/_form.scssindex 6cfa70f938..b4a4b2efa6 100644--- a/app/src/assets/scss/component/_form.scss+++ b/app/src/assets/scss/component/_form.scss@@ -55,9 +55,14 @@right: 0;cursor: pointer;- &:hover {+ &:hover:not([disabled]) {opacity: 1;}++ &[disabled] {+ opacity: .38;+ cursor: not-allowed;+ }}// repo password & av descriptiondiff --git a/app/src/mobile/menu/search.ts b/app/src/mobile/menu/search.tsindex 1ba75f2a81..ead99d4b31 100644--- a/app/src/mobile/menu/search.ts+++ b/app/src/mobile/menu/search.ts@@ -1,4 +1,5 @@import {closePanel} from "../util/closePanel";+import {updateSearchMethodControls} from "../../search/methodCapabilities";import {buildSearchRequest} from "../../search/config";import {getAttr} from "../../search/attrs";import type {APICallbackResponse, APIPOSTRoutes} from "../../types/api";@@ -277,6 +278,7 @@ export const updateSearchResult = (config: Config.IUILayoutTabSearchConfig, elemcurrentId?: string,newId?: string}) => {+ updateSearchMethodControls(element, config, true);if (rmCurrentCriteria) {element.querySelector("#criteria .b3-chip--current")?.classList.remove("b3-chip--current");element.querySelector("#searchList").innerHTML = "";@@ -492,7 +494,7 @@ const initSearchEvent = (app: App, element: Element, config: Config.IUILayoutTabevent.stopPropagation();event.preventDefault();break;- } else if (type === "remove-path") {+ } else if (type === "remove-path" && !target.hasAttribute("disabled")) {config.idPath = [];config.hPath = "";element.querySelector("#searchPath").classList.add("fn__none");@@ -545,7 +547,7 @@ const initSearchEvent = (app: App, element: Element, config: Config.IUILayoutTabevent.stopPropagation();event.preventDefault();break;- } else if (type === "path") {+ } else if (type === "path" && !target.hasAttribute("disabled")) {movePathTo({cb: (toPath, toNotebook) => {fetchPost("/api/filetree/getHPathsByPaths", {paths: toPath}, (response) => {@@ -607,7 +609,7 @@ const initSearchEvent = (app: App, element: Element, config: Config.IUILayoutTabevent.stopPropagation();event.preventDefault();break;- } else if (type === "toggle-replace") {+ } else if (type === "toggle-replace" && !target.hasAttribute("disabled")) {if (window.siyuan.isPublish) {return;}diff --git a/app/src/search/menu.ts b/app/src/search/menu.tsindex 360b3a1346..0e77a87c72 100644--- a/app/src/search/menu.ts+++ b/app/src/search/menu.ts@@ -12,8 +12,21 @@ import {goUnRef, updateSearchResult} from "../mobile/menu/search";import {bindSearchSubtypeFilters} from "./subTypes";import {getDefaultSubType, normalizeSearchTypes} from "./getDefault";import {hasSearchConfigTemporaryPath, resolvePersistedSearchConfig} from "./config";+import {getSearchMethodCapabilities, isSearchSortAvailable, setSearchControlAvailability} from "./methodCapabilities";++const withSearchMethodAvailability = (item: IMenu, enabled: boolean): IMenu => ({+ ...item,+ disabled: !enabled,+ bind: (element) => {+ item.bind?.(element);+ setSearchControlAvailability(element, enabled, item.label, !enabled);+ },+});export const filterMenu = (config: Config.IUILayoutTabSearchConfig, cb: () => void) => {+ if (!getSearchMethodCapabilities(config.method, config.group).filter) {+ return;+ }config.types = normalizeSearchTypes(config.types);const filterDialog = new Dialog({title: window.siyuan.languages.searchType,@@ -255,6 +268,9 @@ export const filterMenu = (config: Config.IUILayoutTabSearchConfig, cb: () => vo};export const replaceFilterMenu = (config: Config.IUILayoutTabSearchConfig) => {+ if (!getSearchMethodCapabilities(config.method, config.group).replace) {+ return;+ }let html = "";Object.keys(Constants.SIYUAN_DEFAULT_REPLACETYPES).forEach((key: keyof Config.IUILayoutTabSearchConfigReplaceTypes) => {html += `<label class="fn__flex b3-label">@@ -468,6 +484,7 @@ export const moreMenu = async (config: Config.IUILayoutTabSearchConfig,cb: () => void,removeCriterion: () => void,layoutMenu?: () => void) => {+ const capabilities = getSearchMethodCapabilities(config.method, config.group);if (!window.siyuan.menus.menu.element.classList.contains("fn__none") &&window.siyuan.menus.menu.element.getAttribute("data-name") === Constants.MENU_SEARCH_MORE) {window.siyuan.menus.menu.remove();@@ -484,7 +501,7 @@ export const moreMenu = async (config: Config.IUILayoutTabSearchConfig,}}).element);window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);- window.siyuan.menus.menu.append(new MenuItem({+ window.siyuan.menus.menu.append(new MenuItem(withSearchMethodAvailability({iconHTML: "",label: window.siyuan.languages.searchType,click() {@@ -492,14 +509,14 @@ export const moreMenu = async (config: Config.IUILayoutTabSearchConfig,updateSearchResult(config, element, true);});}- }).element);- window.siyuan.menus.menu.append(new MenuItem({+ }, capabilities.filter)).element);+ window.siyuan.menus.menu.append(new MenuItem(withSearchMethodAvailability({iconHTML: "",label: window.siyuan.languages.replaceType,click() {replaceFilterMenu(config);}- }).element);+ }, capabilities.replace)).element);const searchMethodSubmenu = [{icon: "iconExact",label: window.siyuan.languages.keyword,@@ -556,7 +573,7 @@ export const moreMenu = async (config: Config.IUILayoutTabSearchConfig,submenu: searchMethodSubmenu}).element);/// #endif- const sortMenu = [{+ const sortMenu: IMenu[] = [{iconHTML: "",label: window.siyuan.languages.type,current: config.sort === 0,@@ -624,13 +641,15 @@ export const moreMenu = async (config: Config.IUILayoutTabSearchConfig,}});}- window.siyuan.menus.menu.append(new MenuItem({+ const sortValues = [0, 1, 2, 3, 4, 6, 7, 5];+ window.siyuan.menus.menu.append(new MenuItem(withSearchMethodAvailability({iconHTML: "",label: window.siyuan.languages.sort,type: "submenu",- submenu: sortMenu,- }).element);- window.siyuan.menus.menu.append(new MenuItem({+ submenu: sortMenu.map((item, index) => withSearchMethodAvailability(item,+ isSearchSortAvailable(config.method, config.group, sortValues[index]))),+ }, capabilities.sort)).element);+ window.siyuan.menus.menu.append(new MenuItem(withSearchMethodAvailability({iconHTML: "",label: window.siyuan.languages.group,type: "submenu",@@ -665,8 +684,8 @@ export const moreMenu = async (config: Config.IUILayoutTabSearchConfig,config.group = 1;cb();}- }]- }).element);+ }].map(item => withSearchMethodAvailability(item, capabilities.group)),+ }, capabilities.group)).element);if (layoutMenu) {layoutMenu();}diff --git a/app/src/search/methodCapabilities.test.ts b/app/src/search/methodCapabilities.test.tsnew file mode 100644index 0000000000..d5fe4d8e71--- /dev/null+++ b/app/src/search/methodCapabilities.test.ts@@ -0,0 +1,93 @@+import * as assert from "node:assert/strict";+import {test} from "node:test";+import {getSearchMethodCapabilities, isSearchSortAvailable, updateSearchMethodControls} from "./methodCapabilities";++test("search capabilities retain supported filters and grouped SQL sorting", () => {+ for (const method of [0, 1, 3]) {+ assert.ok(getSearchMethodCapabilities(method, 0).filter);+ assert.ok(getSearchMethodCapabilities(method, 0).path);+ assert.ok(getSearchMethodCapabilities(method, 0).replace);+ assert.ok(getSearchMethodCapabilities(method, 0).group);+ }+ assert.deepEqual(getSearchMethodCapabilities(2, 0), {filter: false, path: false, replace: false, group: true, sort: false});+ assert.deepEqual(getSearchMethodCapabilities(4, 1), {filter: true, path: true, replace: false, group: false, sort: false});+ for (const method of [0, 1, 2, 3, 4]) {+ for (const group of [0, 1]) {+ assert.equal(isSearchSortAvailable(method, group, 5), method !== 4 && group === 1);+ for (const sort of [6, 7]) {+ assert.equal(isSearchSortAvailable(method, group, sort), method === 0 || method === 1);+ }+ for (const sort of [0, 1, 2, 3, 4]) {+ assert.equal(isSearchSortAvailable(method, group, sort), method !== 4 && (method !== 2 || group === 1));+ }+ }+ }+});++const control = () => {+ const attributes: Record<string, string> = {};+ const classes = new Set<string>();+ return {+ attributes, classes,+ toggleAttribute: (name: string, force: boolean) => { if (force) { attributes[name] = ""; } else { delete attributes[name]; } },+ setAttribute: (name: string, value: string) => { attributes[name] = value; },+ classList: {toggle: (name: string, force: boolean) => { if (force) { classes.add(name); } else { classes.delete(name); } }},+ };+};++for (const mobile of [true, false]) {+ test(`${mobile ? "mobile" : "desktop"} method switches preserve replacement text and restore controls`, () => {+ const previousWindow = globalThis.window;+ const previousDocument = globalThis.document;+ globalThis.window = {siyuan: {languages: {+ searchControlUnavailable: "unavailable", specifyPath: "path", searchType: "types", includeChildDoc: "children",+ filterCurrentDocument: "current document", replace: "replace", remove: "remove",+ }}} as unknown as Window & typeof globalThis;+ globalThis.document = {querySelector: () => ({classList: {contains: () => true}})} as unknown as Document;+ try {+ const controls = new Map<string, ReturnType<typeof control>>();+ const row = {...control(), value: "replacement text"};+ const expand = {...control(), parentElement: control()};+ const element = {+ querySelector: (selector: string) => {+ if (selector === ".toolbar") { return row; }+ if (selector === "#searchExpand") { return expand; }+ if (!controls.has(selector)) { controls.set(selector, control()); }+ return controls.get(selector);+ },+ querySelectorAll: () => [control(), row],+ };+ const config = {method: 0, group: 1, hasReplace: true, r: "replacement text", idPath: ["notebook/document.sy"]};+ const filter = mobile ? '[data-type="path"]' : "#searchFilter";+ const include = mobile ? '[data-type="include"]' : "#searchInclude";+ const refresh = () => updateSearchMethodControls(element as unknown as Element, config as Config.IUILayoutTabSearchConfig, mobile);+ refresh();+ assert.equal(row.classes.has("fn__none"), false);+ config.method = 2;+ refresh();+ assert.equal(row.classes.has("fn__none"), true);+ assert.equal(controls.get(filter).attributes["aria-disabled"], "true");+ assert.equal(controls.get(include).attributes["aria-disabled"], "true");+ assert.ok(controls.get(filter).attributes.title.endsWith("unavailable"));+ config.method = 4;+ refresh();+ assert.equal(row.classes.has("fn__none"), true);+ assert.equal(controls.get(filter).attributes["aria-disabled"], "false");+ assert.equal(controls.get(include).attributes["aria-disabled"], "false");+ config.method = 1;+ refresh();+ assert.equal(row.classes.has("fn__none"), false);+ assert.equal(row.value, "replacement text");+ assert.equal(config.r, "replacement text");+ assert.equal(config.hasReplace, true);+ assert.deepEqual(config.idPath, ["notebook/document.sy"]);+ config.idPath = [];+ refresh();+ assert.equal(controls.get(include).attributes["aria-disabled"], "true");+ assert.equal(controls.get(filter).attributes.title.includes("unavailable"), false);+ } finally {+ globalThis.window = previousWindow;+ globalThis.document = previousDocument;+ }+ });+}diff --git a/app/src/search/methodCapabilities.ts b/app/src/search/methodCapabilities.tsnew file mode 100644index 0000000000..754ca999ca--- /dev/null+++ b/app/src/search/methodCapabilities.ts@@ -0,0 +1,65 @@+export const getSearchMethodCapabilities = (method: number, group: number) => ({+ filter: method !== 2,+ path: method !== 2,+ replace: method !== 2 && method !== 4,+ group: method !== 4,+ sort: method !== 4 && (method !== 2 || group === 1),+});++// SQL 分组后的时间和内容排序由内核整理,相关度仅适用于关键字和查询语法。+export const isSearchSortAvailable = (method: number, group: number, sort: number): boolean => {+ if (!getSearchMethodCapabilities(method, group).sort) {+ return false;+ }+ if (sort === 5) {+ return group === 1;+ }+ return sort !== 6 && sort !== 7 || method === 0 || method === 1;+};++export const setSearchControlAvailability = (element: Element | null, enabled: boolean,+ label: string, methodUnavailable = false) => {+ if (!element) {+ return;+ }+ element.toggleAttribute("disabled", !enabled);+ element.setAttribute("aria-disabled", String(!enabled));+ const tip = methodUnavailable ? `${label} - ${window.siyuan.languages.searchControlUnavailable}` : label;+ element.setAttribute("aria-label", tip);+ element.setAttribute("title", tip);+};++export const updateSearchMethodControls = (element: Element, config: Config.IUILayoutTabSearchConfig,+ mobile = false) => {+ const capabilities = getSearchMethodCapabilities(config.method, config.group);+ const language = window.siyuan.languages;+ const pathAvailable = capabilities.path;+ const includeAvailable = (config.idPath || []).some(path => path.split("/").length > 1);+ const controls: Array<[string, boolean, string, boolean]> = mobile ? [+ ['[data-type="path"]', pathAvailable, language.specifyPath, !pathAvailable],+ ['[data-type="include"]', pathAvailable && includeAvailable, language.includeChildDoc, !pathAvailable],+ ['[data-type="currentPath"]', Boolean(pathAvailable &&+ document.querySelector("#empty")?.classList.contains("fn__none")), language.filterCurrentDocument, !pathAvailable],+ ['[data-type="toggle-replace"]', capabilities.replace, language.replace, !capabilities.replace],+ ['#searchPath [data-type="remove-path"]', pathAvailable, language.remove, !pathAvailable],+ ] : [+ ["#searchFilter", capabilities.filter, language.searchType, !capabilities.filter],+ ["#searchPath", pathAvailable, language.specifyPath, !pathAvailable],+ ["#searchPathInput .search__rmpath", pathAvailable, language.remove, !pathAvailable],+ ["#searchInclude", pathAvailable && includeAvailable, language.includeChildDoc, !pathAvailable],+ ["#searchReplace", capabilities.replace, language.replace, !capabilities.replace],+ ];+ controls.forEach(([selector, enabled, label, unavailable]) => {+ setSearchControlAvailability(element.querySelector(selector), enabled, label, unavailable);+ });+ const replaceVisible = Boolean(config.hasReplace && capabilities.replace && !window.siyuan.isPublish);+ const replaceRow = mobile ? element.querySelector(".toolbar") : element.querySelectorAll(".search__header")[1];+ replaceRow?.classList.toggle("fn__none", !replaceVisible);+ if (mobile) {+ element.querySelector('[data-type="toggle-replace"]')?.classList.toggle("toolbar__icon--active", replaceVisible);+ element.querySelector('[data-type="expand"]')?.classList.toggle("fn__none", config.group !== 1 || !capabilities.group);+ element.querySelector('[data-type="contract"]')?.classList.toggle("fn__none", config.group !== 1 || !capabilities.group);+ } else {+ element.querySelector("#searchExpand")?.parentElement.classList.toggle("fn__none", config.group !== 1 || !capabilities.group);+ }+};diff --git a/app/src/search/methodMenu.test.ts b/app/src/search/methodMenu.test.tsnew file mode 100644index 0000000000..6f76111a0c--- /dev/null+++ b/app/src/search/methodMenu.test.ts@@ -0,0 +1,49 @@+import * as assert from "node:assert/strict";+import {readFileSync} from "node:fs";+import {test} from "node:test";+import {runInNewContext} from "node:vm";+import {ModuleKind, ScriptTarget, transpileModule} from "typescript";+import * as capabilities from "./methodCapabilities";++const {parse} = require("ifdef-loader/preprocessor");++for (const mobile of [true, false]) {+ for (const [method, group] of [[0, 0], [2, 0], [2, 1], [3, 1], [4, 1]]) {+ test(`${mobile ? "mobile" : "desktop"} search menus disable only unsupported options (${method}, ${group})`, async () => {+ const items: IMenu[] = [];+ const languages = new Proxy({}, {get: (_target, key) => key});+ const menu = {element: {classList: {contains: () => true}, setAttribute() {}},+ remove() {}, append: (item: IMenu) => items.push(item)};+ const dependencies: Record<string, unknown> = {+ "./methodCapabilities": capabilities,+ "../menus/Menu": {MenuItem: class {element: IMenu; constructor(options: IMenu) { this.element = options; }}},+ "../constants": {Constants: {MENU_SEARCH_MORE: "more"}},+ "../protyle/util/compatibility": {isDisabledFeature: () => false},+ };+ const source = parse(readFileSync("src/search/menu.ts", "utf8"),+ {MOBILE: mobile, BROWSER: true}, false, true, "menu.ts");+ const code = transpileModule(source, {+ compilerOptions: {module: ModuleKind.CommonJS, target: ScriptTarget.ES2021},+ }).outputText;+ const exports: {moreMenu?: (...args: unknown[]) => Promise<void>} = {};+ runInNewContext(code, {exports, require: (name: string) => dependencies[name] || {},+ window: {siyuan: {languages, menus: {menu}, config: {ai: {embedding: {enabled: true}}}}}});+ await exports.moreMenu({method, group, sort: 0}, [], {}, () => {}, () => {});+ const sort = items.find(item => item.label === "sort");+ const grouping = items.find(item => item.label === "group");+ assert.equal(Boolean(sort.disabled), method === 4 || (method === 2 && group === 0));+ assert.equal(Boolean(grouping.disabled), method === 4);+ assert.ok(grouping.submenu.every(item => Boolean(item.disabled) === (method === 4)));+ for (const item of sort.submenu) {+ const rank = item.label === "sortByRankAsc" || item.label === "sortByRankDesc";+ assert.equal(Boolean(item.disabled), Boolean(sort.disabled) || (rank && method !== 0 && method !== 1));+ }+ assert.equal(Boolean(items.find(item => item.label === "saveCriterion").disabled), false);+ assert.equal(Boolean(items.find(item => item.label === "removeCriterion").disabled), false);+ if (mobile) {+ assert.equal(Boolean(items.find(item => item.label === "searchType").disabled), method === 2);+ assert.equal(Boolean(items.find(item => item.label === "replaceType").disabled), method === 2 || method === 4);+ }+ });+ }+}diff --git a/app/src/search/util.ts b/app/src/search/util.tsindex 81b59e772f..0842e2dbc9 100644--- a/app/src/search/util.ts+++ b/app/src/search/util.ts@@ -1,4 +1,5 @@import type {FileTreeGetDocRequestInput} from "../types/api";+import {updateSearchMethodControls} from "./methodCapabilities";import {getAttr} from "./attrs";import type {APICallbackResponse, APIPOSTRoutes, BlockQueryRequestInput} from "../types/api";import {getAllModels} from "../layout/getAll";@@ -486,7 +487,7 @@ export const genSearch = (app: App, config: Config.IUILayoutTabSearchConfig, eleevent.stopPropagation();event.preventDefault();break;- } else if (target.classList.contains("search__rmpath")) {+ } else if (target.classList.contains("search__rmpath") && !target.hasAttribute("disabled")) {invalidateSearchPathRequests(element);config.idPath = [];config.hPath = "";@@ -520,7 +521,7 @@ export const genSearch = (app: App, config: Config.IUILayoutTabSearchConfig, eleevent.stopPropagation();event.preventDefault();break;- } else if (target.id === "searchPath") {+ } else if (target.id === "searchPath" && !target.hasAttribute("disabled")) {movePathTo({cb: (toPath, toNotebook) => {const isCurrentPathRequest = beginSearchPathRequest(element);@@ -588,7 +589,7 @@ export const genSearch = (app: App, config: Config.IUILayoutTabSearchConfig, eleconfig.page = 1;inputEvent(element, config, edit, true);break;- } else if (target.id === "searchReplace") {+ } else if (target.id === "searchReplace" && !target.hasAttribute("disabled")) {if (window.siyuan.isPublish) {return;}@@ -749,7 +750,7 @@ export const genSearch = (app: App, config: Config.IUILayoutTabSearchConfig, eleevent.stopPropagation();event.preventDefault();break;- } else if (target.id === "searchFilter") {+ } else if (target.id === "searchFilter" && !target.hasAttribute("disabled")) {window.siyuan.menus.menu.remove();filterMenu(config, () => {config.page = 1;@@ -1505,6 +1506,7 @@ export const inputEvent = (element: Element, config: Config.IUILayoutTabSearchCocurrentId?: string,newId?: string}) => {+ updateSearchMethodControls(element, config);if (rmCurrentCriteria) {element.querySelector("#criteria .b3-chip--current")?.classList.remove("b3-chip--current");element.querySelector("#searchList").innerHTML = "";