@@ -1371,16 +1371,18 @@ def outer_type_or_annotation(field: FieldInfo):
1371
1371
else :
1372
1372
return field .annotation .__args__ [0 ] # type: ignore
1373
1373
1374
- def should_index_field (field_info : FieldInfo ) -> bool :
1374
+
1375
+ def should_index_field (field_info : PydanticFieldInfo ) -> bool :
1375
1376
# for vector, full text search, and sortable fields, we always have to index
1376
1377
# We could require the user to set index=True, but that would be a breaking change
1377
1378
return (
1378
1379
getattr (field_info , "index" , False ) is True
1379
- or getattr (field_info , "vector_options" , None ) is not None
1380
- or getattr (field_info , "full_text_search" , False ) is True
1381
- or getattr (field_info , "sortable" , False ) is True
1380
+ or getattr (field_info , "vector_options" , None ) is not None
1381
+ or getattr (field_info , "full_text_search" , False ) is True
1382
+ or getattr (field_info , "sortable" , False ) is True
1382
1383
)
1383
1384
1385
+
1384
1386
class RedisModel (BaseModel , abc .ABC , metaclass = ModelMeta ):
1385
1387
pk : Optional [str ] = Field (
1386
1388
# Indexing for backwards compatibility, we might not want this in the future
0 commit comments