     {:or [(range-condition->elastic (query-field->elastic-field min-field concept-type)
                                     min-value
                                     max-value
-                                    "index")
+                                    (numeric-range-execution-mode)
+                                    (numeric-range-use-cache))
           (range-condition->elastic (query-field->elastic-field max-field concept-type)
                                     min-value
                                     max-value
-                                    "index")
+                                    (numeric-range-execution-mode)
+                                    (numeric-range-use-cache))
           {:and [(range-condition->elastic (query-field->elastic-field min-field concept-type)
                                            nil
                                            min-value
-                                           "index")
+                                           (numeric-range-execution-mode)
+                                           (numeric-range-use-cache))
                  (range-condition->elastic (query-field->elastic-field max-field concept-type)
                                            max-value
                                            nil
-                                           "index")]}]})
+                                           (numeric-range-execution-mode)
+                                           (numeric-range-use-cache))]}]})
 
   cmr.search.models.query.StringRangeCondition
   (condition->elastic

(defn- range-condition->elastic
  "Convert a range condition to an elastic search condition. Execution
  should either by 'fielddata' or 'index'."
  [field min-value max-value execution]
  (cond
    (and min-value max-value)
    {:range {field {:gte min-value :lte max-value}
             :execution execution}}

    min-value
    {:range {field {:gte min-value}
             :execution execution}}

    max-value
    {:range {field {:lte max-value}
             :execution execution}}

    :else
    (errors/internal-error! (m/nil-min-max-msg))))

(extend-protocol ConditionToElastic
  cmr.search.models.query.ConditionGroup

            [cmr.search.data.datetime-helper :as h]
            [cmr.common.services.errors :as errors]
            [cmr.search.data.messages :as m]
            [cmr.search.data.keywords-to-elastic :as k2e]
            [cmr.common.config :as cfg]))

(def numeric-range-execution-mode (cfg/config-value-fn :numeric-range-execution-mode "index"))
(def numeric-range-use-cache (cfg/config-value-fn "true" :numeric-range-use-cache #(= "true" %)))

(def field-mappings
  "A map of fields in the query to the field name in elastic. Field names are excluded from this
