def fulltextQuery(fields, cutoff_frequency=None):
    """Build a fulltext search query

    Creates a `multi_match` query for the list of `fields` provided.
    If a `cutoff_frequency` is given it will be added to the query.
    """
    def handleParameter(value):
        value = value.strip()
        if not value:
            raise ValueError("No query string provided")
        result = {
            "multi_match": {
                "query": value,
                "fields": fields
                }
            }
        if cutoff_frequency is not None:
            result['multi_match']['cutoff_frequency'] = cutoff_frequency
        return result
    return handleParameter