def transform_results(results, keys_of_interest):
    """
    Take a list of results and convert them to a multi valued dictionary. The
    real world use case is to take values from a list of collections and pass
    them to a granule search.

    [{key1:value1},{key1:value2},...] -> {"key1": [value1,value2]} ->
        &key1=value1&key1=value2 ( via expand_query_to_parameters() )
    """
    params = {}
    for item in results:
        for key in keys_of_interest:
            if key in item:
                value = item[key]
                if key in params:
                    params[key].append(value)
                else:
                    params[key] = [value]
    return params