def escape_special_characters(input_string):
    """ Escape special characters to avoid unwanted behavior.

    Note that they are not stored in the index so you cannot search for them.

    Args:
        input_string (str): String to escape special characters of

    Returns:
        str: Input string that has its special characters escaped
    """
    prepared_string = input_string
    for special_char in ("\\", "+", "-", "&", "|", "!", "(", ")", "{", "}", "[", "]", "^", "~", "*", "?", ":"):
        if special_char in prepared_string:
            prepared_string = prepared_string.replace(special_char, "\\" + special_char)
    return prepared_string