   (condition->elastic
     [{:keys [field value case-sensitive? pattern?]} concept-type]
     (let [field (query-field->elastic-field field concept-type)
-          field (if case-sensitive? field (str (name field) ".lowercase"))
+          field (if case-sensitive? field (field->lowercase-field field))
           value (if case-sensitive? value (str/lower-case value))]
       (if pattern?
         {:query {:wildcard {field value}}}

    ;; paging and query results consistent.
    (concat specified-sort [concept-id-sort])))

(defn- range-condition->elastic
  "Convert a range condition to an elastic search condition. Execution
  should either by 'fielddata' or 'index'."

  (condition->elastic
    [{:keys [field values case-sensitive?]} concept-type]
    (let [field (query-field->elastic-field field concept-type)
          field (if case-sensitive? field (field->lowercase-field field))
          values (if case-sensitive? values (map str/lower-case values))]
      {:terms {field values
               :execution "plain"}}))
