   (if (:deleted concept)
     (get-elastic-doc-for-tombstone-collection context concept)
     (get-elastic-doc-for-full-collection context concept collection)))
-

        insert-time (get-in collection [:data-provider-timestamps :insert-time])
        insert-time (f/unparse (f/formatters :date-time) insert-time)
        spatial-representation (get-in collection [:spatial-coverage :spatial-representation])
        permitted-group-ids (acl/get-coll-permitted-group-ids context provider-id collection)]
    (merge {:concept-id concept-id
            :revision-id revision-id
            :concept-seq-id (:sequence-number (concepts/parse-concept-id concept-id))
            :native-id native-id

  nil if none exists."
  [personnel]
  (first (filter person->email-contact personnel)))

(defn- get-tag-associations-for-collection
  "Get all the tag associations for a collection"
  [context concept]
  (let [params {:associated-concept-id (:concept-id concept)
                :exclude-metadata true
                :latest true}
        tag-associations (mdb/find-concepts context params :tag-association)]
    (proto/save 1)
    ;; we only want the tag associations that have no associated revision id or one equal to the
    ;; revision of this collection
    (filter (fn [ta] (let [rev-id (:associated-revision-id ta)]
                       (or (nil? rev-id)
                           (= (rev-id (:revision-id concept)))))))))

(defn- get-elastic-doc-for-full-collection
  "Get all the fields for a normal collection index operation."
