[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
- [GMG-Devel] [PATCH 00/83] Search plugin, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 01/83] Register search plugin with mediagoblin.ini, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 02/83] Correct indices storage dictionary in config_spec.ini, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 03/83] Refactor exceptions raised by the search plugin, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 04/83] Fix typos in search.models, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 05/83] Rename models.py to indices.py as these will not be stored in db., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 06/83] Remove global constants from the top of indices.py, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 07/83] Fix imports and other bugs in indices.py, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 08/83] Add schemas.py which will store all index schemas.,
Alon Levy <=
- [GMG-Devel] [PATCH 09/83] Store also the field names in the SearchIndex object which is also necessary while searching., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 10/83] Correct the class index schema class., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 11/83] Add indexer for MediaEntry objects., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 12/83] Add IndexRegistry class to maintain the search indices., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 13/83] Clean up plugins.search.indices, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 14/83] Rename base.py to registry.py and indices.py to base.py., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 15/83] Add index identifier to SearchIndex., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 16/83] Correct the index identifier., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 17/83] Collect all indices in indices.py, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 18/83] Add method to create a document from a model instance, Alon Levy, 2014/02/25