Skip to content

glide_sync.sync_commands.ft

module for vector search commands.

create(client, index_name, schema, options=None)

Creates an index and initiates a backfill of that index.

Parameters:

Name Type Description Default
client TGlideClient

The client to execute the command.

required
index_name TEncodable

The index name.

required
schema List[Field]

Fields to populate into the index. Equivalent to SCHEMA block in the module API.

required
options Optional[FtCreateOptions]

Optional arguments for the FT.CREATE command.

None

Returns:

Name Type Description
TOK TOK

A simple "OK" response.

Examples:

>>> from glide import ft
>>> schema: List[Field] = [TextField("title")]
>>> prefixes: List[str] = ["blog:post:"]
>>> ft.create(glide_client, "my_idx1", schema, FtCreateOptions(DataType.HASH, prefixes))
    'OK'  # Indicates successful creation of index named 'idx'
Source code in doc-gen/valkey-glide/python/glide-sync/glide_sync/sync_commands/ft.py
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
def create(
    client: TGlideClient,
    index_name: TEncodable,
    schema: List[Field],
    options: Optional[FtCreateOptions] = None,
) -> TOK:
    """
    Creates an index and initiates a backfill of that index.

    Args:
        client (TGlideClient): The client to execute the command.
        index_name (TEncodable): The index name.
        schema (List[Field]): Fields to populate into the index. Equivalent to `SCHEMA` block in the module API.
        options (Optional[FtCreateOptions]): Optional arguments for the FT.CREATE command.

    Returns:
        TOK: A simple "OK" response.

    Examples:
        >>> from glide import ft
        >>> schema: List[Field] = [TextField("title")]
        >>> prefixes: List[str] = ["blog:post:"]
        >>> ft.create(glide_client, "my_idx1", schema, FtCreateOptions(DataType.HASH, prefixes))
            'OK'  # Indicates successful creation of index named 'idx'
    """
    args: List[TEncodable] = [CommandNames.FT_CREATE, index_name]
    if options:
        args.extend(options.to_args())
    if schema:
        args.append(FtCreateKeywords.SCHEMA)
        for field in schema:
            args.extend(field.to_args())
    return cast(TOK, client.custom_command(args))

dropindex(client, index_name)

Drops an index. The index definition and associated content are deleted. Keys are unaffected.

Parameters:

Name Type Description Default
client TGlideClient

The client to execute the command.

required
index_name TEncodable

The index name for the index to be dropped.

required

Returns:

Name Type Description
TOK TOK

A simple "OK" response.

Examples:

For the following example to work, an index named 'idx' must be already created. If not created, you will get an error.

>>> from glide import ft
>>> index_name = "idx"
>>> ft.dropindex(glide_client, index_name)
    'OK'  # Indicates successful deletion/dropping of index named 'idx'
Source code in doc-gen/valkey-glide/python/glide-sync/glide_sync/sync_commands/ft.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
def dropindex(client: TGlideClient, index_name: TEncodable) -> TOK:
    """
    Drops an index. The index definition and associated content are deleted. Keys are unaffected.

    Args:
        client (TGlideClient): The client to execute the command.
        index_name (TEncodable): The index name for the index to be dropped.

    Returns:
        TOK: A simple "OK" response.

    Examples:
        For the following example to work, an index named 'idx' must be already created. If not created, you will get an error.
        >>> from glide import ft
        >>> index_name = "idx"
        >>> ft.dropindex(glide_client, index_name)
            'OK'  # Indicates successful deletion/dropping of index named 'idx'
    """
    args: List[TEncodable] = [CommandNames.FT_DROPINDEX, index_name]
    return cast(TOK, client.custom_command(args))

list(client)

Lists all indexes.

Parameters:

Name Type Description Default
client TGlideClient

The client to execute the command.

required

Returns:

Type Description
List[TEncodable]

List[TEncodable]: An array of index names.

Examples:

>>> from glide import ft
>>> ft.list(glide_client)
    [b"index1", b"index2"]
Source code in doc-gen/valkey-glide/python/glide-sync/glide_sync/sync_commands/ft.py
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
def list(client: TGlideClient) -> List[TEncodable]:
    """
    Lists all indexes.

    Args:
        client (TGlideClient): The client to execute the command.

    Returns:
        List[TEncodable]: An array of index names.

    Examples:
        >>> from glide import ft
        >>> ft.list(glide_client)
            [b"index1", b"index2"]
    """
    return cast(List[TEncodable], client.custom_command([CommandNames.FT_LIST]))

search(client, index_name, query, options)

Uses the provided query expression to locate keys within an index. Once located, the count and/or the content of indexed fields within those keys can be returned.

Parameters:

Name Type Description Default
client TGlideClient

The client to execute the command.

required
index_name TEncodable

The index name to search into.

required
query TEncodable

The text query to search.

required
options Optional[FtSearchOptions]

The search options.

required

Returns:

Name Type Description
FtSearchResponse FtSearchResponse

A two element array, where first element is count of documents in result set, and the second element, which has the format Mapping[TEncodable, Mapping[TEncodable, TEncodable]] is a mapping between document names and map of their attributes.

FtSearchResponse

If count(option in FtSearchOptions) is set to true or limit(option in FtSearchOptions) is set to FtSearchLimit(0, 0), the command returns array with only one element - the count of the documents.

Examples:

For the following example to work the following must already exist: - An index named "idx", with fields having identifiers as "a" and "b" and prefix as "{json:}" - A key named {json:}1 with value {"a":1, "b":2}

>>> from glide import ft
>>> ft.search(
...     glide_client,
...     "idx",
...     "*",
...     options=FtSeachOptions(
...         return_fields=[
...             ReturnField(field_identifier="first"),
...             ReturnField(field_identifier="second")
...         ]
...     )
... )
[1, { b'json:1': { b'first': b'42', b'second': b'33' } }]
# The first element, 1 is the number of keys returned in the search result. The second element is a map of
# data queried per key.
Source code in doc-gen/valkey-glide/python/glide-sync/glide_sync/sync_commands/ft.py
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
def search(
    client: TGlideClient,
    index_name: TEncodable,
    query: TEncodable,
    options: Optional[FtSearchOptions],
) -> FtSearchResponse:
    """
    Uses the provided query expression to locate keys within an index. Once located, the count and/or the content of indexed
    fields within those keys can be returned.

    Args:
        client (TGlideClient): The client to execute the command.
        index_name (TEncodable): The index name to search into.
        query (TEncodable): The text query to search.
        options (Optional[FtSearchOptions]): The search options.

    Returns:
        FtSearchResponse: A two element array, where first element is count of documents in result set, and the second
            element, which has the format Mapping[TEncodable, Mapping[TEncodable, TEncodable]] is a mapping between document
            names and map of their attributes.
        If count(option in `FtSearchOptions`) is set to true or limit(option in `FtSearchOptions`) is set to
            FtSearchLimit(0, 0), the command returns array with only one element - the count of the documents.

    Examples:
        For the following example to work the following must already exist:
        - An index named "idx", with fields having identifiers as "a" and "b" and prefix as "{json:}"
        - A key named {json:}1 with value {"a":1, "b":2}

        >>> from glide import ft
        >>> ft.search(
        ...     glide_client,
        ...     "idx",
        ...     "*",
        ...     options=FtSeachOptions(
        ...         return_fields=[
        ...             ReturnField(field_identifier="first"),
        ...             ReturnField(field_identifier="second")
        ...         ]
        ...     )
        ... )
        [1, { b'json:1': { b'first': b'42', b'second': b'33' } }]
        # The first element, 1 is the number of keys returned in the search result. The second element is a map of
        # data queried per key.
    """
    args: List[TEncodable] = [CommandNames.FT_SEARCH, index_name, query]
    if options:
        args.extend(options.to_args())
    return cast(FtSearchResponse, client.custom_command(args))

aliasadd(client, alias, index_name)

Adds an alias for an index. The new alias name can be used anywhere that an index name is required.

Parameters:

Name Type Description Default
client TGlideClient

The client to execute the command.

required
alias TEncodable

The alias to be added to an index.

required
index_name TEncodable

The index name for which the alias has to be added.

required

Returns:

Name Type Description
TOK TOK

A simple "OK" response.

Examples:

>>> from glide import ft
>>> ft.aliasadd(glide_client, "myalias", "myindex")
    'OK'  # Indicates the successful addition of the alias named "myalias" for the index.
Source code in doc-gen/valkey-glide/python/glide-sync/glide_sync/sync_commands/ft.py
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
def aliasadd(client: TGlideClient, alias: TEncodable, index_name: TEncodable) -> TOK:
    """
    Adds an alias for an index. The new alias name can be used anywhere that an index name is required.

    Args:
        client (TGlideClient): The client to execute the command.
        alias (TEncodable): The alias to be added to an index.
        index_name (TEncodable): The index name for which the alias has to be added.

    Returns:
        TOK: A simple "OK" response.

    Examples:
        >>> from glide import ft
        >>> ft.aliasadd(glide_client, "myalias", "myindex")
            'OK'  # Indicates the successful addition of the alias named "myalias" for the index.
    """
    args: List[TEncodable] = [CommandNames.FT_ALIASADD, alias, index_name]
    return cast(TOK, client.custom_command(args))

aliasdel(client, alias)

Deletes an existing alias for an index.

Parameters:

Name Type Description Default
client TGlideClient

The client to execute the command.

required
alias TEncodable

The existing alias to be deleted for an index.

required

Returns:

Name Type Description
TOK TOK

A simple "OK" response.

Examples:

>>> from glide import ft
>>> ft.aliasdel(glide_client, "myalias")
    'OK'  # Indicates the successful deletion of the alias named "myalias"
Source code in doc-gen/valkey-glide/python/glide-sync/glide_sync/sync_commands/ft.py
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
def aliasdel(client: TGlideClient, alias: TEncodable) -> TOK:
    """
    Deletes an existing alias for an index.

    Args:
        client (TGlideClient): The client to execute the command.
        alias (TEncodable): The existing alias to be deleted for an index.

    Returns:
        TOK: A simple "OK" response.

    Examples:
        >>> from glide import ft
        >>> ft.aliasdel(glide_client, "myalias")
            'OK'  # Indicates the successful deletion of the alias named "myalias"
    """
    args: List[TEncodable] = [CommandNames.FT_ALIASDEL, alias]
    return cast(TOK, client.custom_command(args))

aliasupdate(client, alias, index_name)

Updates an existing alias to point to a different physical index. This command only affects future references to the alias.

Parameters:

Name Type Description Default
client TGlideClient

The client to execute the command.

required
alias TEncodable

The alias name. This alias will now be pointed to a different index.

required
index_name TEncodable

The index name for which an existing alias has to updated.

required

Returns:

Name Type Description
TOK TOK

A simple "OK" response.

Examples:

>>> from glide import ft
>>> ft.aliasupdate(glide_client, "myalias", "myindex")
    'OK'  # Indicates the successful update of the alias to point to the index named "myindex"
Source code in doc-gen/valkey-glide/python/glide-sync/glide_sync/sync_commands/ft.py
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
def aliasupdate(client: TGlideClient, alias: TEncodable, index_name: TEncodable) -> TOK:
    """
    Updates an existing alias to point to a different physical index. This command only affects future references to the alias.

    Args:
        client (TGlideClient): The client to execute the command.
        alias (TEncodable): The alias name. This alias will now be pointed to a different index.
        index_name (TEncodable): The index name for which an existing alias has to updated.

    Returns:
        TOK: A simple "OK" response.

    Examples:
        >>> from glide import ft
        >>> ft.aliasupdate(glide_client, "myalias", "myindex")
            'OK'  # Indicates the successful update of the alias to point to the index named "myindex"
    """
    args: List[TEncodable] = [CommandNames.FT_ALIASUPDATE, alias, index_name]
    return cast(TOK, client.custom_command(args))

info(client, index_name)

Returns information about a given index.

Parameters:

Name Type Description Default
client TGlideClient

The client to execute the command.

required
index_name TEncodable

The index name for which the information has to be returned.

required

Returns:

Name Type Description
FtInfoResponse FtInfoResponse

Nested maps with info about the index. See example for more details.

Examples:

An index with name 'myIndex', 1 text field and 1 vector field is already created for gettting the output of this example.

>>> from glide import ft
>>> ft.info(glide_client, "myIndex")
    [
        b'index_name',
        b'myIndex',
        b'creation_timestamp', 1729531116945240,
        b'key_type', b'JSON',
        b'key_prefixes', [b'key-prefix'],
        b'fields', [
            [
                b'identifier', b'$.vec',
                b'field_name', b'VEC',
                b'type', b'VECTOR',
                b'option', b'',
                b'vector_params', [
                    b'algorithm',
                    b'HNSW',
                    b'data_type',
                    b'FLOAT32',
                    b'dimension',
                    2,
                    b'distance_metric',
                    b'L2',
                    b'initial_capacity',
                    1000,
                    b'current_capacity',
                    1000,
                    b'maximum_edges',
                    16,
                    b'ef_construction',
                    200,
                    b'ef_runtime',
                    10,
                    b'epsilon',
                    b'0.01'
                ]
            ],
            [
                b'identifier', b'$.text-field',
                b'field_name', b'text-field',
                b'type', b'TEXT',
                b'option', b''
            ]
        ],
        b'space_usage', 653351,
        b'fulltext_space_usage', 0,
        b'vector_space_usage', 653351,
        b'num_docs', 0,
        b'num_indexed_vectors', 0,
        b'current_lag', 0,
        b'index_status', b'AVAILABLE',
        b'index_degradation_percentage', 0
    ]
Source code in doc-gen/valkey-glide/python/glide-sync/glide_sync/sync_commands/ft.py
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
def info(client: TGlideClient, index_name: TEncodable) -> FtInfoResponse:
    """
    Returns information about a given index.

    Args:
        client (TGlideClient): The client to execute the command.
        index_name (TEncodable): The index name for which the information has to be returned.

    Returns:
        FtInfoResponse: Nested maps with info about the index. See example for more details.

    Examples:
        An index with name 'myIndex', 1 text field and 1 vector field is already created for gettting the output of this
        example.
        >>> from glide import ft
        >>> ft.info(glide_client, "myIndex")
            [
                b'index_name',
                b'myIndex',
                b'creation_timestamp', 1729531116945240,
                b'key_type', b'JSON',
                b'key_prefixes', [b'key-prefix'],
                b'fields', [
                    [
                        b'identifier', b'$.vec',
                        b'field_name', b'VEC',
                        b'type', b'VECTOR',
                        b'option', b'',
                        b'vector_params', [
                            b'algorithm',
                            b'HNSW',
                            b'data_type',
                            b'FLOAT32',
                            b'dimension',
                            2,
                            b'distance_metric',
                            b'L2',
                            b'initial_capacity',
                            1000,
                            b'current_capacity',
                            1000,
                            b'maximum_edges',
                            16,
                            b'ef_construction',
                            200,
                            b'ef_runtime',
                            10,
                            b'epsilon',
                            b'0.01'
                        ]
                    ],
                    [
                        b'identifier', b'$.text-field',
                        b'field_name', b'text-field',
                        b'type', b'TEXT',
                        b'option', b''
                    ]
                ],
                b'space_usage', 653351,
                b'fulltext_space_usage', 0,
                b'vector_space_usage', 653351,
                b'num_docs', 0,
                b'num_indexed_vectors', 0,
                b'current_lag', 0,
                b'index_status', b'AVAILABLE',
                b'index_degradation_percentage', 0
            ]
    """
    args: List[TEncodable] = [CommandNames.FT_INFO, index_name]
    return cast(FtInfoResponse, client.custom_command(args))

explain(client, index_name, query)

Parse a query and return information about how that query was parsed.

Args:
    client (TGlideClient): The client to execute the command.
    index_name (TEncodable): The index name for which the query is written.
    query (TEncodable): The search query, same as the query passed as an argument to FT.SEARCH.

Returns:
    TEncodable: A string containing the parsed results representing the execution plan.

Examples:
    >>> from glide import ft
    >>> ft.explain(glide_client, indexName="myIndex", query="@price:[0 10]")
        b'Field {

price 0 10 } ' # Parsed results.

Source code in doc-gen/valkey-glide/python/glide-sync/glide_sync/sync_commands/ft.py
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
def explain(
    client: TGlideClient, index_name: TEncodable, query: TEncodable
) -> TEncodable:
    """
    Parse a query and return information about how that query was parsed.

    Args:
        client (TGlideClient): The client to execute the command.
        index_name (TEncodable): The index name for which the query is written.
        query (TEncodable): The search query, same as the query passed as an argument to FT.SEARCH.

    Returns:
        TEncodable: A string containing the parsed results representing the execution plan.

    Examples:
        >>> from glide import ft
        >>> ft.explain(glide_client, indexName="myIndex", query="@price:[0 10]")
            b'Field {\n  price\n  0\n  10\n}\n' # Parsed results.
    """
    args: List[TEncodable] = [CommandNames.FT_EXPLAIN, index_name, query]
    return cast(TEncodable, client.custom_command(args))

explaincli(client, index_name, query)

Same as the FT.EXPLAIN command except that the results are displayed in a different format. More useful with cli.

Parameters:

Name Type Description Default
client TGlideClient

The client to execute the command.

required
index_name TEncodable

The index name for which the query is written.

required
query TEncodable

The search query, same as the query passed as an argument to FT.SEARCH.

required

Returns:

Type Description
List[TEncodable]

List[TEncodable]: An array containing the execution plan.

Examples:

>>> from glide import ft
>>> ft.explaincli(glide_client, indexName="myIndex", query="@price:[0 10]")
    [b'Field {', b'  price', b'  0', b'  10', b'}', b''] # Parsed results.
Source code in doc-gen/valkey-glide/python/glide-sync/glide_sync/sync_commands/ft.py
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
def explaincli(
    client: TGlideClient, index_name: TEncodable, query: TEncodable
) -> List[TEncodable]:
    """
    Same as the FT.EXPLAIN command except that the results are displayed in a different format. More useful with cli.

    Args:
        client (TGlideClient): The client to execute the command.
        index_name (TEncodable): The index name for which the query is written.
        query (TEncodable): The search query, same as the query passed as an argument to FT.SEARCH.

    Returns:
        List[TEncodable]: An array containing the execution plan.

    Examples:
        >>> from glide import ft
        >>> ft.explaincli(glide_client, indexName="myIndex", query="@price:[0 10]")
            [b'Field {', b'  price', b'  0', b'  10', b'}', b''] # Parsed results.
    """
    args: List[TEncodable] = [CommandNames.FT_EXPLAINCLI, index_name, query]
    return cast(List[TEncodable], client.custom_command(args))

aggregate(client, index_name, query, options)

A superset of the FT.SEARCH command, it allows substantial additional processing of the keys selected by the query expression.

Parameters:

Name Type Description Default
client TGlideClient

The client to execute the command.

required
index_name TEncodable

The index name for which the query is written.

required
query TEncodable

The search query, same as the query passed as an argument to FT.SEARCH.

required
options Optional[FtAggregateOptions]

The optional arguments for the command.

required

Returns:

Name Type Description
FtAggregateResponse FtAggregateResponse

An array containing a mapping of field name and associated value as returned after the last stage of the command.

Examples:

>>> from glide import ft
>>> ft.aggregate(
...     glide_client,
...     "myIndex",
...     "*",
...     FtAggregateOptions(
...         loadFields=["__key"],
...         clauses=[GroupBy(["@condition"], [Reducer("COUNT", [], "bicycles")])]
...    )
... )
    [
        {
            b'condition': b'refurbished',
            b'bicycles': b'1'
        },
        {
            b'condition': b'new',
            b'bicycles': b'5'
        },
        {
            b'condition': b'used',
            b'bicycles': b'4'
        }
    ]
Source code in doc-gen/valkey-glide/python/glide-sync/glide_sync/sync_commands/ft.py
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
def aggregate(
    client: TGlideClient,
    index_name: TEncodable,
    query: TEncodable,
    options: Optional[FtAggregateOptions],
) -> FtAggregateResponse:
    """
    A superset of the FT.SEARCH command, it allows substantial additional processing of the keys selected by the query
    expression.

    Args:
        client (TGlideClient): The client to execute the command.
        index_name (TEncodable): The index name for which the query is written.
        query (TEncodable): The search query, same as the query passed as an argument to FT.SEARCH.
        options (Optional[FtAggregateOptions]): The optional arguments for the command.

    Returns:
        FtAggregateResponse: An array containing a mapping of field name and associated value as returned after the last stage
            of the command.

    Examples:
        >>> from glide import ft
        >>> ft.aggregate(
        ...     glide_client,
        ...     "myIndex",
        ...     "*",
        ...     FtAggregateOptions(
        ...         loadFields=["__key"],
        ...         clauses=[GroupBy(["@condition"], [Reducer("COUNT", [], "bicycles")])]
        ...    )
        ... )
            [
                {
                    b'condition': b'refurbished',
                    b'bicycles': b'1'
                },
                {
                    b'condition': b'new',
                    b'bicycles': b'5'
                },
                {
                    b'condition': b'used',
                    b'bicycles': b'4'
                }
            ]
    """
    args: List[TEncodable] = [CommandNames.FT_AGGREGATE, index_name, query]
    if options:
        args.extend(options.to_args())
    return cast(FtAggregateResponse, client.custom_command(args))

profile(client, index_name, options)

Runs a search or aggregation query and collects performance profiling information.

Parameters:

Name Type Description Default
client TGlideClient

The client to execute the command.

required
index_name TEncodable

The index name

required
options FtProfileOptions

Options for the command.

required

Returns:

Name Type Description
FtProfileResponse FtProfileResponse

A two-element array. The first element contains results of query being profiled, the second element stores profiling information.

Examples:

>>> ftSearchOptions = FtSeachOptions(
...     return_fields=[
...         ReturnField(field_identifier="a", alias="a_new"),
...         ReturnField(field_identifier="b", alias="b_new")
...     ]
... )
>>> ft.profile(
...     glide_client,
...     "myIndex",
...     FtProfileOptions.from_query_options(query="*", queryOptions=ftSearchOptions)
... )
    [
        [
            2,
            {
                b'key1': {
                    b'a': b'11111',
                    b'b': b'2'
                },
                b'key2': {
                    b'a': b'22222',
                    b'b': b'2'
                }
            }
        ],
        {
            b'all.count': 2,
            b'sync.time': 1,
            b'query.time': 7,
            b'result.count': 2,
            b'result.time': 0
        }
    ]
Source code in doc-gen/valkey-glide/python/glide-sync/glide_sync/sync_commands/ft.py
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
def profile(
    client: TGlideClient, index_name: TEncodable, options: FtProfileOptions
) -> FtProfileResponse:
    """
    Runs a search or aggregation query and collects performance profiling information.

    Args:
        client (TGlideClient): The client to execute the command.
        index_name (TEncodable): The index name
        options (FtProfileOptions): Options for the command.

    Returns:
        FtProfileResponse: A two-element array. The first element contains results of query being profiled, the second element
            stores profiling information.

    Examples:
        >>> ftSearchOptions = FtSeachOptions(
        ...     return_fields=[
        ...         ReturnField(field_identifier="a", alias="a_new"),
        ...         ReturnField(field_identifier="b", alias="b_new")
        ...     ]
        ... )
        >>> ft.profile(
        ...     glide_client,
        ...     "myIndex",
        ...     FtProfileOptions.from_query_options(query="*", queryOptions=ftSearchOptions)
        ... )
            [
                [
                    2,
                    {
                        b'key1': {
                            b'a': b'11111',
                            b'b': b'2'
                        },
                        b'key2': {
                            b'a': b'22222',
                            b'b': b'2'
                        }
                    }
                ],
                {
                    b'all.count': 2,
                    b'sync.time': 1,
                    b'query.time': 7,
                    b'result.count': 2,
                    b'result.time': 0
                }
            ]
    """
    args: List[TEncodable] = [CommandNames.FT_PROFILE, index_name] + options.to_args()
    return cast(FtProfileResponse, client.custom_command(args))

aliaslist(client)

List the index aliases. Args: client (TGlideClient): The client to execute the command. Returns: Mapping[TEncodable, TEncodable]: A map of index aliases for indices being aliased. Examples: >>> from glide import ft >>> ft._aliaslist(glide_client) {b'alias': b'index1', b'alias-bytes': b'index2'}

Source code in doc-gen/valkey-glide/python/glide-sync/glide_sync/sync_commands/ft.py
448
449
450
451
452
453
454
455
456
457
458
459
460
461
def aliaslist(client: TGlideClient) -> Mapping[TEncodable, TEncodable]:
    """
    List the index aliases.
    Args:
        client (TGlideClient): The client to execute the command.
    Returns:
        Mapping[TEncodable, TEncodable]: A map of index aliases for indices being aliased.
    Examples:
        >>> from glide import ft
        >>> ft._aliaslist(glide_client)
            {b'alias': b'index1', b'alias-bytes': b'index2'}
    """
    args: List[TEncodable] = [CommandNames.FT_ALIASLIST]
    return cast(Mapping, client.custom_command(args))