Browse Source

fix: no matched search results for page reference autocomplete

Tienson Qin 3 năm trước cách đây
mục cha
commit
4e964688e5
2 tập tin đã thay đổi với 2 bổ sung5 xóa
  1. 1 1
      src/main/frontend/handler/editor.cljs
  2. 1 4
      src/main/frontend/search/db.cljs

+ 1 - 1
src/main/frontend/handler/editor.cljs

@@ -1560,7 +1560,7 @@
         editing-page (and block
                           (when-let [page-id (:db/id (:block/page block))]
                             (:block/name (db/entity page-id))))
-        pages (search/page-search q 20)]
+        pages (search/page-search q 100)]
     (if editing-page
       ;; To prevent self references
       (remove (fn [p] (= (util/page-name-sanity-lc p) editing-page)) pages)

+ 1 - 4
src/main/frontend/search/db.cljs

@@ -59,9 +59,6 @@
                         (clj->js {:keys ["name"]
                                   :shouldSort true
                                   :tokenize true
-                                  :minMatchCharLength 1
-                                  :distance 1000
-                                  :threshold 0.35
-                                  }))]
+                                  :minMatchCharLength 1}))]
       (swap! indices assoc-in [repo :pages] indice)
       indice)))