Explorar el Código

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

Related to #1469
Tienson Qin hace 4 años
padre
commit
7c58af63c0
Se han modificado 1 ficheros con 8 adiciones y 4 borrados
  1. 8 4
      src/main/frontend/search.cljs

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

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