makes solr ec2 based and adds resiliency to running balances.
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user