diff --git a/python/python/glide/async_commands/server_modules/vss_options.py b/python/python/glide/async_commands/server_modules/vss_options.py index 0c7ef90404..96c428e78b 100644 --- a/python/python/glide/async_commands/server_modules/vss_options.py +++ b/python/python/glide/async_commands/server_modules/vss_options.py @@ -52,9 +52,11 @@ class FtCreateOptions: def __init__( self, dataType: Optional[DataType], + prefixes: Optional[List[str]], fields: List[FieldInfo], ): self.dataType = dataType + self.prefixes = prefixes self.fields = fields def getCreateOptions(self) -> List[str]: @@ -62,6 +64,11 @@ def getCreateOptions(self) -> List[str]: if self.dataType: args.append("ON") args.append(self.dataType.name) + if self.prefixes: + args.append("PREFIX") + args.append(str(len(self.prefixes))) + for prefix in self.prefixes: + args.append(prefix) if self.fields: args.append("SCHEMA") for fieldInfo in self.fields: diff --git a/python/python/tests/tests_server_modules/test_vss.py b/python/python/tests/tests_server_modules/test_vss.py index 63acab0b0c..5ea0b12309 100644 --- a/python/python/tests/tests_server_modules/test_vss.py +++ b/python/python/tests/tests_server_modules/test_vss.py @@ -19,9 +19,12 @@ async def test_vss_create(self, glide_client: TGlideClient): fields.append(fieldInfo1) fields.append(fieldInfo2) fields.append(fieldInfo3) - options: FtCreateOptions = FtCreateOptions(DataType.HASH, fields) + + prefixes: List[str] = [] + prefixes.append("blog:post:") + options: FtCreateOptions = FtCreateOptions(DataType.HASH, prefixes, fields) result = await vss.create(glide_client, index, options) assert result == OK - + # print info command result print(await vss.info(glide_client, index))