working on solr stuff.

This commit is contained in:
Bryce
2023-06-06 21:08:19 -07:00
parent d2cb0763d7
commit de6c6b3031
7 changed files with 268 additions and 321 deletions

View File

@@ -203,3 +203,34 @@
(index-documents impl index [i])))
(defrecord InMemSolrClient [data-set-atom]
SolrClient
(index-documents [this index xs]
(swap! data-set-atom
(fn [data-set]
(reduce
(fn [data-set x]
(let [thing (datomic->solr x)]
(update data-set index conj [(str/join " " (vals x)) thing])))
data-set
xs)))
nil)
(index-documents-raw [this index xs]
(swap! data-set-atom
(fn [data-set]
(reduce
(fn [data-set x]
(update data-set index conj [(str/join " " (vals x)) x]))
data-set
xs))))
(query [this index q]
(filter
(fn [[x e]]
(str/includes? x (get q "query")))
(get @data-set-atom index)))
(delete [this index]
(swap! data-set-atom dissoc index)))