Просмотр исходного кода

fix: Search fails for words that are present after about 44 chars

Related to #1469
Tienson Qin 4 лет назад
Родитель
Сommit
7c58af63c0
1 измененных файлов с 8 добавлено и 4 удалено
  1. 8 4
      src/main/frontend/search.cljs

+ 8 - 4
src/main/frontend/search.cljs

@@ -38,8 +38,10 @@
           indice (fuse. blocks
           indice (fuse. blocks
                         (clj->js {:keys ["uuid" "content"]
                         (clj->js {:keys ["uuid" "content"]
                                   :shouldSort true
                                   :shouldSort true
-                                  :minMatchCharLength 2
-                                  :threshold 0.2}))]
+                                  :tokenize true
+                                  :minMatchCharLength 3
+                                  :distance 1000
+                                  :threshold 0.35}))]
       (swap! indices assoc-in [repo :blocks] indice)
       (swap! indices assoc-in [repo :blocks] indice)
       indice)))
       indice)))
 
 
@@ -53,8 +55,10 @@
           indice (fuse. pages
           indice (fuse. pages
                         (clj->js {:keys ["name"]
                         (clj->js {:keys ["name"]
                                   :shouldSort true
                                   :shouldSort true
-                                  :minMatchCharLength 2
-                                  :threshold 0.2
+                                  :tokenize true
+                                  :minMatchCharLength 3
+                                  :distance 1000
+                                  :threshold 0.35
                                   }))]
                                   }))]
       (swap! indices assoc-in [repo :pages] indice)
       (swap! indices assoc-in [repo :pages] indice)
       indice)))
       indice)))