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

    """
    if len(ctx.doc.esm_model_grids):
        ctx.ext.summary_fields += ctx.doc.esm_model_grids[0
            ].short_name, ctx.doc.esm_model_grids[0].long_name
    elif len(ctx.doc.esm_exchange_grids):
        ctx.ext.summary_fields += ctx.doc.esm_exchange_grids[0
            ].short_name, ctx.doc.esm_exchange_grids[0].long_name
