Skip to content

Commit 62eac11

Browse files
committed
fix: search doesn't returns matched pages
1 parent 6945771 commit 62eac11

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

‎src/main/frontend/worker/search.cljs‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,6 @@ DROP TRIGGER IF EXISTS blocks_au;
594594
(when-not (string/blank? q)
595595
(let [option (assoc option :enable-snippet? enable-snippet?)
596596
match-input (get-match-input q)
597-
page-count (count (d/datoms @conn :avet :block/name))
598-
large-graph? (> page-count 2500)
599597
non-match-input (when (<= (count q) 2)
600598
(str "%" (string/replace q #"\s+" "%") "%"))
601599
limit (or limit 100)
@@ -613,11 +611,9 @@ DROP TRIGGER IF EXISTS blocks_au;
613611
(->> (search-blocks-aux search-db non-match-sql q non-match-input page limit-p)
614612
(map (fn [result]
615613
(assoc result :keyword-score (fuzzy/score q (:title result)))))))
616-
;; fuzzy is too slow for large graphs
617-
fuzzy-result (when-not (or page large-graph?)
618-
(->> (fuzzy-search repo @conn q option)
619-
(map (fn [result]
620-
(assoc result :keyword-score (fuzzy/score q (:title result)))))))
614+
fuzzy-result (->> (fuzzy-search repo @conn q option)
615+
(map (fn [result]
616+
(assoc result :keyword-score (fuzzy/score q (:title result))))))
621617
;; _ (prn :debug "Search results before combine:" enable-snippet? (map :snippet matched-result))
622618
;; _ (doseq [item (concat fuzzy-result matched-result)]
623619
;; (prn :debug :keyword-search-result item))

0 commit comments

Comments
 (0)