From b750649cb2c166c9742165db31a61f8c85064d44 Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Sat, 15 Oct 2022 20:43:52 +0100 Subject: [PATCH] replace 'Created At' timetamp with 'Month' and 'Year' (search.lisp). 'Month' and 'Year' refer to the artworks publish date. --- src/search.lisp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/search.lisp b/src/search.lisp index e4dc2e3..c41871e 100644 --- a/src/search.lisp +++ b/src/search.lisp @@ -30,7 +30,7 @@ the keywords with a space. 'art blog post' is classed as three tokens and (format nil "~{~A~^,~}" (search:get-keywords (search:find-entry id)))) (defun build-payload (id-value title-value relative-path-value - thumbnail-path-value created-at-value keywords-value) + thumbnail-path-value publish-month-value publish-year-value keywords-value) "Creates a JSON object which reflects the schema in the meilsearch database. Note: The JSON object to encoded as a string." (cl-json:encode-json-to-string @@ -38,10 +38,9 @@ Note: The JSON object to encoded as a string." ("title" . ,title-value) ("relative-path" . ,relative-path-value) ("thumbnail-path" . ,thumbnail-path-value) - ("year" . ,(local-time:timestamp-year created-at-value)) - ("month" . ,(utils:month-number-to-name - (local-time:timestamp-month created-at-value))) - ("day" . ,(local-time:timestamp-day created-at-value)) + ("year" . ,publish-year-value) + ("month" . ,publish-month-value) + ;; ("day" . ,(local-time:timestamp-day created-at-value)) ("keywords" . ,(cl-ppcre:split "," keywords-value)))))) (defun build-search-url (path)