def _cleanquery(querystring):
    """ Cleans up the query - replaces internal
    single quotation marks with double quotes, so
    Solr produces correct results.
    
    Solr is sensitive to the difference between ' and " -
    it will regard terms surrounded with '...' as separate
    queryterms, but "..." as a single concatenated phrase.
    """
    return querystring.replace('\'', '\"')