Browse Source

refactor build search URL feat. in search package (site-settings).

I've left the old code as a comment just in case I need to reverse course. The
new way the function gets the (Meilisearch )search URL is to get it from the
database (site-settings table). This should make it easier to pass the URL
around between the back-end and front-end.
stable
Craig Oates 2 years ago
parent
commit
55f12b3f5b
  1. 15
      src/search.lisp

15
src/search.lisp

@ -4,7 +4,9 @@
#:archive
#:cl-json
#:local-time
#:utils)
#:utils
#:site-settings
#:nera)
(:import-from #:dexador
#:request)
(:export #:build-keywords-string
@ -52,10 +54,13 @@ The function will check to see which environment the current instance of this
site is running in and use the beta or prod. URL's to connect to meilisearch.
`PATH' is the relative path which this function will concatenate onto the end of
the base URL."
(if (ritherdon-archive.config:developmentp)
(concatenate 'string "http://localhost:7700" path)
;; (utils:build-url-root)
(concatenate 'string "https://www.nera.com" path)))
;; (if (ritherdon-archive.config:developmentp)
;; (concatenate 'string "http://localhost:7700" path)
;; ;; (utils:build-url-root)
;; (concatenate 'string "https://www.nera.com" path))
(format nil "~a~a" (site-settings::search-url-of (nera:get-site-settings)) path))
(defun delete-entry (id)
"Deletes and entry from the meilisearch database based on its `ID'.

Loading…
Cancel
Save