working on solr stuff.
This commit is contained in:
@@ -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)))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user