functionAdded in 0.0-927 clojure.set/index
(index xrel ks)

Source docstring:
Returns a map of the distinct values of ks in the xrel mapped to a
set of the maps in xrel with the corresponding values of ks.
Source code @ clojurescript:src/main/cljs/clojure/set.cljs
(defn index
  [xrel ks]
     (fn [m x]
       (let [ik (select-keys x ks)]
         (assoc m ik (conj (get m ik #{}) x))))
     {} xrel))

Edit Here!