and is designed to be easy to use and understand.The following are the available filter types:RedisText: Filter by full-text search against metadata fields. Supports exact, fuzzy, and wildcard matching.RedisNum: Filter by numeric range against metadata fields.RedisTag: Filter by exact match against string based categorical metadata fields. Multiple tags can be specified like "tag1,tag2,tag3".The following are examples of utilizing these filters.from langchain.vectorstores.redis import RedisText, RedisNum, RedisTag# exact matchinghas_high_credit = RedisTag("credit_score") == "high"does_not_have_high_credit = RedisTag("credit_score") != "low"# fuzzy matchingjob_starts_with_eng = RedisText("job") % "eng*"job_is_engineer = RedisText("job") == "engineer"job_is_not_engineer = RedisText("job") != "engineer"# numeric filteringage_is_18 = RedisNum("age") == 18age_is_not_18 = RedisNum("age") != 18age_is_greater_than_18 = RedisNum("age") > 18age_is_less_than_18 = RedisNum("age") < 18age_is_greater_than_or_equal_to_18 = RedisNum("age") >= 18age_is_less_than_or_equal_to_18 = RedisNum("age") <= 18The RedisFilter class can be used to simplify the import of these filters as followsfrom langchain.vectorstores.redis import RedisFilter# same examples as abovehas_high_credit = RedisFilter.tag("credit_score") == "high"does_not_have_high_credit = RedisFilter.num("age") > 8job_starts_with_eng = RedisFilter.text("job") % "eng*"The following are examples of using hybrid filter for searchfrom langchain.vectorstores.redis import RedisTextis_engineer = RedisText("job") == "engineer"results = rds.similarity_search("foo", k=3, filter=is_engineer)print("Job:", results[0].metadata["job"])print("Engineers in the dataset:", len(results))    Job: engineer    Engineers in the dataset: 2# fuzzy matchstarts_with_doc = RedisText("job") % "doc*"results = rds.similarity_search("foo", k=3, filter=starts_with_doc)for result in results:    print("Job:", result.metadata["job"])print("Jobs in dataset that
Redis vector database introduction and langchain integration guide.
Redis vector database introduction and langchain integration guide. ->: and is designed to be easy to use and understand.The following are the available filter types:RedisText: Filter by full-text search against metadata fields. Supports exact, fuzzy, and wildcard matching.RedisNum: Filter by numeric range against metadata fields.RedisTag: Filter by exact match against string based categorical metadata fields. Multiple tags can be specified like "tag1,tag2,tag3".The following are examples of utilizing these filters.from langchain.vectorstores.redis import RedisText, RedisNum, RedisTag# exact matchinghas_high_credit = RedisTag("credit_score") == "high"does_not_have_high_credit = RedisTag("credit_score") != "low"# fuzzy matchingjob_starts_with_eng = RedisText("job") % "eng*"job_is_engineer = RedisText("job") == "engineer"job_is_not_engineer = RedisText("job") != "engineer"# numeric filteringage_is_18 = RedisNum("age") == 18age_is_not_18 = RedisNum("age") != 18age_is_greater_than_18 = RedisNum("age") > 18age_is_less_than_18 = RedisNum("age") < 18age_is_greater_than_or_equal_to_18 = RedisNum("age") >= 18age_is_less_than_or_equal_to_18 = RedisNum("age") <= 18The RedisFilter class can be used to simplify the import of these filters as followsfrom langchain.vectorstores.redis import RedisFilter# same examples as abovehas_high_credit = RedisFilter.tag("credit_score") == "high"does_not_have_high_credit = RedisFilter.num("age") > 8job_starts_with_eng = RedisFilter.text("job") % "eng*"The following are examples of using hybrid filter for searchfrom langchain.vectorstores.redis import RedisTextis_engineer = RedisText("job") == "engineer"results = rds.similarity_search("foo", k=3, filter=is_engineer)print("Job:", results[0].metadata["job"])print("Engineers in the dataset:", len(results))    Job: engineer    Engineers in the dataset: 2# fuzzy matchstarts_with_doc = RedisText("job") % "doc*"results = rds.similarity_search("foo", k=3, filter=starts_with_doc)for result in results:    print("Job:", result.metadata["job"])print("Jobs in dataset that