Skip to content

[Bug 🐞] Full-Text Search is incorrectly allowed on List[str] fields /w max_items #702

@XChikuX

Description

@XChikuX

The Bug:

When pydantic's max_items attribute is given a value.

interests: list[str] = Field(
    ...,
    full_text_search=True,
    max_items=10,
    max_length=20,
    title="Interests",
    description="List of interests. Upto 10 items, 20 character max",
)

redis-om silently passes.

What should Happen:

favorites: list[str] = Field(
    ...,
    full_text_search=True,
    title="Favorites",
    description="List of user IDs that this user has favorited",
)

OUTPUT: aredis_om.model.model.RedisModelError: List and tuple fields cannot be indexed for full-text search. Problem field: favorites. See docs: TODO

Environment:
python = 3.12
redis-om = 0.3.3
pydantic = v1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions