def METHOD_NAME(self, pid, record_hit, links_factory=None,
                          **kwargs):
    """Prepare a record hit from Elasticsearch for serialization."""
    result = super(ZenodoJSONSerializer, self).METHOD_NAME(
        pid, record_hit, links_factory=links_factory, **kwargs
    )
    # Add files if in search hit (only public files exists in index)
    if '_files' in record_hit['_source']:
        result['files'] = record_hit['_source']['_files']
    elif '_files' in record_hit:
        result['files'] = record_hit['_files']
    else:
        # delete the bucket if no files
        result['metadata'].pop('_buckets', None)
    return result