def render_original_record(document)
      agg = document.aggregation
      return error_msg('Aggregation not found.') unless agg.present?

      begin
        original_record = agg.original_record
      rescue StandardError => e
        logger.error e.message
        return error_msg(e.message)
      end

      return error_msg('Original record not found.') unless
        original_record.present?
      prettify_string(original_record.to_s, original_record.content_type)
    end
def render_original_record(document)
      agg = document.aggregation
      return error_msg('Aggregation not found.') unless agg.present?

      begin
        original_record = agg.original_record
      rescue StandardError => e
        logger.error e.message
        return error_msg(e.message)
      end

      return error_msg('Original record not found.') unless
        original_record.present?
      prettify_string(original_record.to_s, original_record.content_type)
    end
Render original record for view
 @param [Krikri::SearchIndexDocument]
 @return [String]