def encode_special_characters(user_string):
    """
    Encode Special Characters for user's search Strings

    Args:
        user_string(string): raw string to encode

    Returns:
        Encode string for elasticsearch
    """
    if user_string is None:
        return ""

    sp_chars = ['+', '-', '=', '|', '<', '>', '!', '(', ')', '{', '}', '[', ']', '^', '"', '~', '*', '?', ':', '\\', '/']
    # List of special characters can be found here: https://www.elastic.co/guide/en/elasticsearch/reference/2.4/query-dsl-query-string-query.html#_reserved_characters
    output_list = []

    for char in user_string:
        if char in sp_chars:
            # replace
            output_list.append(char.replace(char, '\\' + char))
        else:
            output_list.append(char)

    return "".join(output_list)