summaryrefslogtreecommitdiff
path: root/redis/commands/search/document.py
blob: 5b3050545ab3a9a7ef98f0b6487b68a5900270a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
class Document:
    """
    Represents a single document in a result set
    """

    def __init__(self, id, payload=None, **fields):
        self.id = id
        self.payload = payload
        for k, v in fields.items():
            setattr(self, k, v)

    def __repr__(self):
        return f"Document {self.__dict__}"