return RedisFilterExpression(str(self))
[docs]class RedisText(RedisFilterField):
    """A RedisFilterField representing a text field in a Redis index."""
    OPERATORS: Dict[RedisFilterOperator, str] = {
        RedisFilterOperator.EQ: "==",
        RedisFilterOperator.NE: "!=",
        RedisFilterOperator.LIKE: "%",
    }
    OPERATOR_MAP: Dict[RedisFilterOperator, str] = {
        RedisFilterOperator.EQ: '@%s:("%s")',
        RedisFilterOperator.NE: '(-@%s:"%s")',
        RedisFilterOperator.LIKE: "@%s:(%s)",
    }
    SUPPORTED_VAL_TYPES = (str, type(None))
    @check_operator_misuse
    def __eq__(self, other: str) -> "RedisFilterExpression":
        """Create a RedisText equality (exact match) filter expression.
        Args:
            other (str): The text value to filter on.
        Example:
            >>> from langchain_community.vectorstores.redis import RedisText
            >>> filter = RedisText("job") == "engineer"
        """
        self._set_value(other, self.SUPPORTED_VAL_TYPES, RedisFilterOperator.EQ)  # type: ignore
        return RedisFilterExpression(str(self))
    @check_operator_misuse
    def __ne__(self, other: str) -> "RedisFilterExpression":
        """Create a RedisText inequality filter expression.
        Args:
            other (str): The text value to filter on.
        Example:
            >>> from langchain_community.vectorstores.redis import RedisText
            >>> filter = RedisText("job") != "engineer"
        """