from typing import List
import itertools


def weights_parameters(fields: List[str], weights: List[float]) -> List[str]:
    """Generate Solr field weight combinations for given field values and weights
    e.g. for ["content", "title"] and [0.1, 1.0] it generates
    ["content^0.1 title^0.1", "content^0.1 title^1.0", "content^1.0 title0.1", "content^1.0 title^1.0"]
    """
    fields_and_weights: List[List[str]] = [[f"{field}^{weight}" for weight in weights] for field in fields]
    return [" ".join(combination) for combination in itertools.product(*fields_and_weights)]