feat: add page content level search plugin API

This commit is contained in:
Junyi
2022-11-24 00:25:33 +08:00
committed by Tienson Qin
parent 310e1a39f6
commit a241bb492e
2 changed files with 21 additions and 0 deletions

View File

@@ -23,6 +23,9 @@
(query [_this q opts]
(call-service! service "search:query" (merge {:q q} opts) true))
(query-page [_this q opts]
(call-service! service "search:queryPage" (merge {:q q} opts) true))
(rebuild-blocks-indice! [_this]
;; Not pushing all data for performance temporarily
;;(let [blocks (search-db/build-blocks-indice repo)])
@@ -34,6 +37,12 @@
{:data {:added blocks-to-add
:removed blocks-to-remove-set}})))
(transact-pages! [_this data]
(let [{:keys [pages-to-remove-set pages-to-add]} data]
(call-service! service "search:transactpages"
{:data {:added pages-to-add
:removed pages-to-remove-set}})))
(truncate-blocks! [_this]
(call-service! service "search:truncateBlocks" {}))