                (r/map->ValueCountMaps
                  {:value field-key
                   :count coll-count})))
-           (into [])
            (assoc response :value-count-maps)))))
 
 (defn- science-keywords-bucket->facets

  (assoc query :aggregations (facet-aggregations (:nested-science-keywords? query))))

(defn- buckets->value-count-pairs
  "Processes an elasticsearch aggregation response of buckets to a sequence of value and count tuples"
  [bucket-map]
  (->> bucket-map
       :buckets

    (let [remaining-fields (rest field-hierarchy)
          next-field (first remaining-fields)
          buckets (get aggregations-for-field :buckets)
          response (r/map->HierarchicalFacet {:field field})]
      (->> (for [bucket buckets
                 :let [field-key (get bucket :key)
                       coll-count (get-in bucket [:coll-count :doc_count])
