@@ -376,20 +376,19 @@ def resolve_field_type(field: ModelField, op: Operators) -> RediSearchFieldTypes
376
376
container_type = get_origin (field_type )
377
377
378
378
if is_supported_container_type (container_type ):
379
- # NOTE: A list of integers , like:
379
+ # NOTE: A list of strings , like:
380
380
#
381
- # luck_numbers : List[int ] = field(index=True)
381
+ # tarot_cards : List[str ] = field(index=True)
382
382
#
383
- # becomes a TAG field, which means that users cannot perform range
384
- # queries on the values within the multi-value field, only equality
385
- # and membership queries.
383
+ # becomes a TAG field, which means that users can run equality and
384
+ # membership queries on values.
386
385
#
387
386
# Meanwhile, a list of RedisModels, like:
388
387
#
389
388
# friends: List[Friend] = field(index=True)
390
389
#
391
390
# is not itself directly indexed, but instead, we index any fields
392
- # within the model marked as `index=True`.
391
+ # within the model inside the list marked as `index=True`.
393
392
return RediSearchFieldTypes .TAG
394
393
elif container_type is not None :
395
394
raise QuerySyntaxError ("Only lists and tuples are supported for multi-value fields. "
@@ -399,9 +398,10 @@ def resolve_field_type(field: ModelField, op: Operators) -> RediSearchFieldTypes
399
398
# range queries.
400
399
return RediSearchFieldTypes .NUMERIC
401
400
else :
402
- # TAG fields are the default field type and support equality and membership queries,
403
- # though membership (and the multi-value nature of the field) are hidden from
404
- # users unless they explicitly index multiple values, with either a list or tuple,
401
+ # TAG fields are the default field type and support equality and
402
+ # membership queries, though membership (and the multi-value nature
403
+ # of the field) are hidden from users unless they explicitly index
404
+ # multiple values, with either a list or tuple,
405
405
# e.g.,
406
406
# favorite_foods: List[str] = field(index=True)
407
407
return RediSearchFieldTypes .TAG
0 commit comments