fix(search): cannot batch insert to search db

pull/6650/head
Andelf 2022-09-08 12:20:46 +08:00
parent 00bc964a9c
commit e196b8eda8
1 changed files with 3 additions and 2 deletions

View File

@ -96,7 +96,7 @@
(when-not (string/blank? q) (when-not (string/blank? q)
(protocol/query engine q option))))) (protocol/query engine q option)))))
(defn transact-blocks! (defn- transact-blocks!
[repo data] [repo data]
(when-let [engine (get-engine repo)] (when-let [engine (get-engine repo)]
(protocol/transact-blocks! engine data))) (protocol/transact-blocks! engine data)))
@ -237,7 +237,8 @@
blocks-to-add (->> (filter (fn [block] blocks-to-add (->> (filter (fn [block]
(contains? blocks-to-add-set (:db/id block))) (contains? blocks-to-add-set (:db/id block)))
blocks-result) blocks-result)
(map search-db/block->index)) (map search-db/block->index)
(remove nil?))
blocks-to-remove-set (->> (remove :added blocks) blocks-to-remove-set (->> (remove :added blocks)
(map :e) (map :e)
(set))] (set))]