MCPcopy
hub / github.com/redis/redis-py / TextField

Class TextField

redis/commands/search/field.py:79–109  ·  view source on GitHub ↗

TextField is used to define a text field in a schema definition

Source from the content-addressed store, hash-verified

77
78
79class TextField(Field):
80 """
81 TextField is used to define a text field in a schema definition
82 """
83
84 NOSTEM = "NOSTEM"
85 PHONETIC = "PHONETIC"
86
87 def __init__(
88 self,
89 name: str,
90 weight: float = 1.0,
91 no_stem: bool = False,
92 phonetic_matcher: str = None,
93 withsuffixtrie: bool = False,
94 **kwargs,
95 ):
96 Field.__init__(self, name, args=[Field.TEXT, Field.WEIGHT, weight], **kwargs)
97
98 if no_stem:
99 Field.append_arg(self, self.NOSTEM)
100 if phonetic_matcher and phonetic_matcher in [
101 "dm:en",
102 "dm:fr",
103 "dm:pt",
104 "dm:es",
105 ]:
106 Field.append_arg(self, self.PHONETIC)
107 Field.append_arg(self, phonetic_matcher)
108 if withsuffixtrie:
109 Field.append_arg(self, "WITHSUFFIXTRIE")
110
111
112class NumericField(Field):

Callers 15

search_vss.pyFile · 0.90
home_json.pyFile · 0.90
query_em.pyFile · 0.90
query_ft.pyFile · 0.90
geo_index.pyFile · 0.90
query_range.pyFile · 0.90
query_combined.pyFile · 0.90
createIndexMethod · 0.90
test_scoresMethod · 0.90

Calls

no outgoing calls

Tested by 15

createIndexMethod · 0.72
test_scoresMethod · 0.72
test_stopwordsMethod · 0.72
test_filtersMethod · 0.72
test_sort_byMethod · 0.72
test_drop_indexMethod · 0.72
test_exampleMethod · 0.72
test_no_indexMethod · 0.72
test_explainMethod · 0.72