def format_entity_query_value(value):
    """Format and if needed, quote a value to be place in an entity search query
    """
    value_s = str(value)
    if len(value_s.split()) > 1:
        return '"{}"'.format(value_s.replace('"', '\\"'))
    else:
        return value_s