def _set_summary_fields(ctx):
    """Sets document summary fields.

    """
    fields = ()
    if hasattr(ctx.doc, 'short_name'):
        fields = fields + (ctx.doc.short_name,)
    elif hasattr(ctx.doc, 'canonical_name'):
        fields = fields + (ctx.doc.canonical_name,)
    if hasattr(ctx.doc, 'long_name'):
        fields = fields + (ctx.doc.long_name,)
    ctx.ext.summary_fields = fields
