From 2cea637b2e936265d2001043d2b2d4e62559dc17 Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Thu, 4 Aug 2022 16:46:28 +0300 Subject: Add support for WITHSUFFIXTRIE to FT.CREATE (#2324) * withsuffixtrie * Update test_search.py * fix --- redis/commands/search/field.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'redis/commands/search') diff --git a/redis/commands/search/field.py b/redis/commands/search/field.py index 89ed973..6f31ce1 100644 --- a/redis/commands/search/field.py +++ b/redis/commands/search/field.py @@ -64,6 +64,7 @@ class TextField(Field): weight: float = 1.0, no_stem: bool = False, phonetic_matcher: str = None, + withsuffixtrie: bool = False, **kwargs, ): Field.__init__(self, name, args=[Field.TEXT, Field.WEIGHT, weight], **kwargs) @@ -78,6 +79,8 @@ class TextField(Field): ]: Field.append_arg(self, self.PHONETIC) Field.append_arg(self, phonetic_matcher) + if withsuffixtrie: + Field.append_arg(self, "WITHSUFFIXTRIE") class NumericField(Field): @@ -108,11 +111,18 @@ class TagField(Field): CASESENSITIVE = "CASESENSITIVE" def __init__( - self, name: str, separator: str = ",", case_sensitive: bool = False, **kwargs + self, + name: str, + separator: str = ",", + case_sensitive: bool = False, + withsuffixtrie: bool = False, + **kwargs, ): args = [Field.TAG, self.SEPARATOR, separator] if case_sensitive: args.append(self.CASESENSITIVE) + if withsuffixtrie: + args.append("WITHSUFFIXTRIE") Field.__init__(self, name, args=args, **kwargs) -- cgit v1.2.1