mediagoblin-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GMG-Devel] [PATCH 08/83] Add schemas.py which will store all index sche


From: Alon Levy
Subject: [GMG-Devel] [PATCH 08/83] Add schemas.py which will store all index schemas.
Date: Tue, 25 Feb 2014 21:57:51 +0200

From: Praveen Kumar <address@hidden>

---
 mediagoblin/plugins/search/schemas.py | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 mediagoblin/plugins/search/schemas.py

diff --git a/mediagoblin/plugins/search/schemas.py 
b/mediagoblin/plugins/search/schemas.py
new file mode 100644
index 0000000..405cf35
--- /dev/null
+++ b/mediagoblin/plugins/search/schemas.py
@@ -0,0 +1,28 @@
+from whoosh.fields import Schema
+from whoosh.fields import ID
+from whoosh.fields import TEXT
+from whoosh.fields import DATETIME
+
+
+class MediaEntrySearchSchema(Schema):
+    """
+    Represents the schema of the search index corresponding 
+    to db.models.MediaEntry objects.
+    """
+    # id of the media entry object. this field is indexed
+    # and is set to be unique so as to facilitate updating
+    # of existing documents in the index
+    id = ID(unique=True)
+
+    # stores same value as that of id but is stored with the index
+    # we need this value if we want to retrieve objects from db
+    id_stored = ID(stored=True)
+
+    uploader = TEXT
+    title = TEXT
+    slug = TEXT
+    created = DATETIME
+    description = TEXT
+    media_type = TEXT
+    license = TEXT
+
-- 
1.8.5.3



reply via email to

[Prev in Thread] Current Thread [Next in Thread]