diff --git a/src/search.lisp b/src/search.lisp index 51a8d21..e4dc2e3 100644 --- a/src/search.lisp +++ b/src/search.lisp @@ -13,7 +13,9 @@ #:get-id #:get-keywords #:submit-entry - #:set-filter-attributes)) + #:set-filter-attributes + #:delete-all-entries + #:create-dump)) (in-package #:search) ;; Explains the "~{~A~^,~}" in the format call below. @@ -124,3 +126,14 @@ has requested. She would like the filtering to consist on years and months." (utils:run-bash-command (format nil "curl -X PATCH \'~a\' -H \'Authorization: ~a\' -H \'Content-Type: application/json\' --data-binary \'{ \"filterableAttributes\": [ \"year\", \"month\", \"keywords\" ]}\'" (build-search-url "/indexes/nera/settings") (meilisearch-api-key)))) + +(defun delete-all-entries () + "Deletes all the archive entries in the Meilisearch database -- not the DB." + (utils:run-bash-command + (format nil "curl -X DELETE \'~a\'" + (build-search-url "/indexes/nera/documents")))) + +(defun create-dump () + "Creates a dump of the Meilisearch database." + (utils:run-bash-command + (format nil "curl -X POST \'~a\'" (build-search-url "/dumps"))))