def generate_Q(solr_instance,field_type,value):
    """
    Helper function takes field type and value and parses out 
    values and returns a sunburnt.Q object or None

    :param solr_instance: Solr instance
    :param field_type: Search field type, should be keyword, author, title,
                       or subject
    :param value: Raw value from the field
    :rtype: sunburnt.Q instance or None
    """
    if value is None or len(value) < 1:
        return None
    if field_type == 'author':
        solr_query = solr_instance.Q()
        for raw_name in value.split(" "):
            name = raw_name.replace(".","")
            solr_query = solr_query & solr_instance.Q(author=name)
    elif field_type == 'topic':
        solr_query = solr_instance.Q(topic=value)
    elif field_type == 'title':
        solr_query = solr_instance.Q(title=value)
    else:
        solr_query = solr_instance.Q()
        for keyword in value.split(" "):
            solr_query = solr_query & solr_instance.Q(keyword)
    return solr_query