                                 :query {:filtered {:query (eq/match-all)
                                                    :filter core-query}}}}}
       (if boosts
-        (errors/throw-service-errors :bad-request ["Relevance boosting is only supported for keyword queries"])))))
-
+        (errors/throw-service-errors :bad-request ["Relevance boosting is only supported for keyword queries"])
+        {:query {:filtered {:query (eq/match-all)
+                              :filter core-query}}}))))
 
 (defmethod q2e/concept-type->sort-key-map :collection
   [_]

  so keyword search will not be broken"
  {:type Boolean
   :default true})

(defn- doc-values-field-name
  "Returns the doc-values field-name for the given field."

   {(q2e/query-field->elastic-field :revision-id :collection) {:order "desc"}}])

(defn- temporal-range->elastic-param
  "Convert a temporal range to the right format for the elastic script. Change the dates to longs, populate
   the start/end dates with defaults as needed, and change the keys to snake case. Do whatever
   processing can be done here rather than the script for performance considerations."
  [temporal-range]
  (let [{:keys [start-date end-date]} temporal-range
        temporal-range {:start-date (if start-date
                                      (time-coerce/to-long start-date)
                                      default-temporal-start-date-time)
                        :end-date (if end-date
                                    (time-coerce/to-long end-date)
                                    (time-coerce/to-long (time/today)))}
        temporal-range (assoc temporal-range :range (- (:end-date temporal-range) (:start-date temporal-range)))]
    (util/map-keys->snake_case temporal-range)))

(def script
  "def totalSpan = 0;
   def totalOverlap = 0;
   for (range in temporalRanges)
   {
     def overlapStartDate = range.start_date;
     if (doc['start-date'].value != 0 && doc['start-date'].value > overlapStartDate)
      { overlapStartDate = doc['start-date'].value; }
     def overlapEndDate = range.end_date;
     if (doc['end-date'].value != 0 && doc['end-date'].value < overlapEndDate)
      { overlapEndDate = doc['end-date'].value; }
     totalOverlap += overlapEndDate - overlapStartDate;
     totalSpan += range.range;
   }
   if (totalSpan > 0)
   {
     totalOverlap / totalSpan;
   }
   else { 0; }")


(defn- temporal-overlap-sort-script
 "Create the script to sort by temporal overlap percent in descending order. Get the temporal ranges
