    :tag-key.lowercase (-> m/string-field-mapping m/stored m/doc-values)
    :description (m/not-indexed (m/stored m/string-field-mapping))
    :originator-id.lowercase (m/stored m/string-field-mapping)})
+
+(defmapping autocomplete-mapping :autocomplete
+  "Defines the elasticsearch mapping for storing autocomplete suggestions.
+   These are the fields that will be stored in an Elasticsearch document."
+  {:_id  {:path "concept-id"}}
+  {:concept-id (-> m/string-field-mapping m/stored m/doc-values)
+   :type (-> m/string-field-mapping m/string-field-mapping)
+   :value {:type "string" :analyzer "autocomplete_analyzer"}})
 
 (defmapping variable-mapping :variable
   "Defines the elasticsearch mapping for storing variables. These are the

                           {:name "all-variable-revisions"
                            :settings variable-setting}]
                          :mapping variable-mapping}
               :service {:indexes
                         [{:name "services"
                           :settings service-setting}

                        :number_of_replicas 1,
                        :refresh_interval "1s"}})

(def autocomplete-settings {:index
                            {:number_of_shards (elastic-autocomplete-index-num-shards)
                             :number_of_replicas 1
                             :refresh_interval "1s"}
                           :analysis
                            {:filter
                             {:autocomplete_filter
                              {:type "edge_ngram"
                               :min_gram 1
                               :max_gram 8}}
                             :analyzer
                             {:autocomplete_analyzer
                              {:type "custom"
                               :tokenizer "standard"
                               :filter ["lowercase" "autocomplete_filter"]}}}})

(def service-setting {:index
                       {:number_of_shards (elastic-service-index-num-shards)
                        :number_of_replicas 1,
                        :refresh_interval "1s"}})


(defnestedmapping attributes-field-mapping
  "Defines mappings for attributes."
