def METHOD_NAME(serializer, mimetype, file_extension,
                           file_prefix=None, file_suffix=None):
    """Create a Records-REST search result response serializer.
    :param serializer: Serializer instance.
    :param mimetype: MIME type of response.
    :param file_extension: File extension.
    :returns: Function that generates a record HTTP response.
    """
    def view(pid_fetcher, search_result, code=200, headers=None, links=None,
             item_links_factory=None):
        response = current_app.response_class(
            serializer.serialize_search(
                pid_fetcher, search_result,
                links=links,
                item_links_factory=item_links_factory
            ),
            mimetype=mimetype
        )
        response.status_code = code
        if headers is not None:
            response.headers.extend(headers)
        tstamp = datetime.today().strftime('%Y%m%d')
        parts = filter(None, [file_prefix, tstamp, file_suffix])
        filename = '-'.join(parts) + '.' + file_extension
        if not response.headers.get('Content-Disposition'):
            response.headers['Content-Disposition'] = \
                f'attachment; filename="{filename}"'
        if links is not None:
            add_link_header(response, links)
        return response
    return view