   ;; Get the variable associations as well.
   (let [batch (map (fn [concept]
                      (let [variable-associations (meta-db/get-associations-for-variable
-                                                  context concept)]
+                                                   context concept)]
                        (assoc concept :variable-associations variable-associations)))
                    batch)]
     (es/prepare-batch context (filter-expired-concepts batch) options)))

                              :variable-associations variable-associations
                              :service-associations service-associations}
                elastic-version (get-elastic-version-with-associations
                                 context concept associations)
                tag-associations (es/parse-non-tombstone-associations
                                  context tag-associations)
                variable-associations (es/parse-non-tombstone-associations
                                       context variable-associations)
                service-associations (es/parse-non-tombstone-associations
                                      context service-associations)
                concept-indexes (idx-set/get-concept-index-names context concept-id revision-id
                                                                 options concept)
                es-doc (es/parsed-concept->elastic-doc
                        context
                        (-> concept
                            (assoc :tag-associations tag-associations)
                            (assoc :variable-associations variable-associations)
                            (assoc :service-associations service-associations))
                        parsed-concept)
                elastic-options (-> options
                                    (select-keys [:all-revisions-index? :ignore-conflict?]))]
            (es/save-document-in-elastic
             context
             concept-indexes
             (concept-mapping-types concept-type)
             es-doc
             concept-id
             revision-id
             elastic-version
             elastic-options)
            (info (format "Finished indexing concept %s, revision-id %s, all-revisions-index? %s"
                          concept-id revision-id all-revisions-index?))))))))


  [context concept-id revision-id options]
  (when-not (and concept-id revision-id)
    (errors/throw-service-error
      :bad-request
      (format "Concept-id %s and revision-id %s cannot be null" concept-id revision-id)))

  (let [{:keys [all-revisions-index?]} options
        concept-type (cs/concept-id->type concept-id)]
