def _get_histogram_settings(agg):
    """
    Get the settings for a histogram aggregation
    :param agg: the histogram aggregation json data
    :return: dict of {setting_name: setting_value}
    """
    histogram_settings = dict(field=agg['field'])

    settings = agg['settings']

    histogram_settings['interval'] = settings.get('interval')

    min_doc_count = settings.get('min_doc_count')
    if min_doc_count:
        histogram_settings['min_doc_count'] = int(min_doc_count)

    return histogram_settings