makes solr ec2 based and adds resiliency to running balances.

This commit is contained in:
2024-09-25 22:01:12 -07:00
parent dc44233640
commit db9e0dc459
8 changed files with 977 additions and 131 deletions

View File

@@ -622,6 +622,31 @@
(range length)))]
(sort comparator results)))
;; TODO replace COULD JUST BE SORT-3
(defn apply-sort-4 [args results]
(let [sort-bys (-> []
(into (:sort args))
(conj {:sort-key "default" :asc (if (contains? args :default-asc?)
(:default-asc? args)
true)})
(conj {:sort-key "e" :asc true}))
length (count sort-bys)
comparator (fn [xs ys]
(reduce
(fn [_ i]
(let [comparison (if (:asc (nth sort-bys i))
(compare (nth xs i) (nth ys i))
(compare (nth ys i) (nth xs i)))]
(if (not= 0 comparison)
(reduced comparison)
0)))
0
(range length)))]
(sort comparator results)))
(defn apply-pagination-raw [args results]
{:entries (->> results
(drop (or (:start args) 0))