summaryrefslogtreecommitdiff
path: root/redis/commands/search/document.py
blob: 26ede34ef1d12b11cbdacc3d0d1a6b4d8ef89942 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import six


class Document(object):
    """
    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 six.iteritems(fields):
            setattr(self, k, v)

    def __repr__(self):
        return "Document %s" % self.__dict__