summaryrefslogtreecommitdiff
path: root/redis/commands/search/document.py
diff options
context:
space:
mode:
Diffstat (limited to 'redis/commands/search/document.py')
-rw-r--r--redis/commands/search/document.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/redis/commands/search/document.py b/redis/commands/search/document.py
new file mode 100644
index 0000000..26ede34
--- /dev/null
+++ b/redis/commands/search/document.py
@@ -0,0 +1,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__