@@ -1371,16 +1371,18 @@ def outer_type_or_annotation(field: FieldInfo):
13711371 else :
13721372 return field .annotation .__args__ [0 ] # type: ignore
13731373
1374- def should_index_field (field_info : FieldInfo ) -> bool :
1374+
1375+ def should_index_field (field_info : PydanticFieldInfo ) -> bool :
13751376 # for vector, full text search, and sortable fields, we always have to index
13761377 # We could require the user to set index=True, but that would be a breaking change
13771378 return (
13781379 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
13821383 )
13831384
1385+
13841386class RedisModel (BaseModel , abc .ABC , metaclass = ModelMeta ):
13851387 pk : Optional [str ] = Field (
13861388 # Indexing for backwards compatibility, we might not want this in the future
0 commit comments