'Returns a dict of fields with weight values'

def get_field_weights(self):

    weights = {}
    for (field_name, field) in self.fields.items():
        if field.boost:
            weights[field_name] = field.boost
    return weights
