<commit_before>(ns cmr.search.data.query-to-elastic
  "Defines protocols and functions to map from a query model to elastic search query"
  (:require [clojurewerkz.elastisch.query :as q]
            [clojure.string :as str]
            [cmr.search.models.query :as qm]
            [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]
            [cmr.search.data.query-order-by-expense :as query-expense]))

(def numeric-range-execution-mode (cfg/config-value-fn :numeric-range-execution-mode "index"))
(def numeric-range-use-cache (cfg/config-value-fn :numeric-range-use-cache "false" #(Boolean. ^String %)))

(def field-mappings
  "A map of fields in the query to the field name in elastic. Field names are excluded from this
  map if the query field name matches the field name in elastic search."
  {:collection {:provider :provider-id
                :version :version-id
                :project :project-sn
                :updated-since :revision-date
                :two-d-coordinate-system-name :two-d-coord-name
                :platform :platform-sn<commit_msg>Change default numeric range execution mode to fielddata<commit_after>(ns cmr.search.data.query-to-elastic
  "Defines protocols and functions to map from a query model to elastic search query"
  (:require [clojurewerkz.elastisch.query :as q]
            [clojure.string :as str]
            [cmr.search.models.query :as qm]
            [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]
            [cmr.search.data.query-order-by-expense :as query-expense]))

(def numeric-range-execution-mode (cfg/config-value-fn :numeric-range-execution-mode "fielddata"))
(def numeric-range-use-cache (cfg/config-value-fn :numeric-range-use-cache "false" #(Boolean. ^String %)))

(def field-mappings
  "A map of fields in the query to the field name in elastic. Field names are excluded from this
  map if the query field name matches the field name in elastic search."
  {:collection {:provider :provider-id
                :version :version-id
                :project :project-sn
                :updated-since :revision-date
                :two-d-coordinate-system-name :two-d-coord-name
                :platform :platform-sn
{'fraction_non_alphanumeric': 0.11254396248534584, 'fraction_numerical': 0.0007815552950371239, 'mean_word_length': 2.506849315068493, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5211609', 'n_tokens_mistral': 797, 'n_tokens_neox': 759, 'n_words': 212}