Skip to content

Feature Request: make Document class subscriptable #2598

Closed
@omarghetti

Description

@omarghetti

Hello everyone!
it is possibile to make the Document class from the redisearch module a subscriptable class? it would make it easier to access fields if someone needs to remap the search results to other structures in their code

example:
for doc in result.docs:
search_output.matches.append(Document(document_id=doc.id, value=doc[filter_name]))

The Document class that I'm using here is another class that i will extend with other values

right now, this code returns an error that tells:

TypeError: 'Document' object is not subscriptable

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions