[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GMG-Devel] [PATCH 17/83] Collect all indices in indices.py
From: |
Alon Levy |
Subject: |
[GMG-Devel] [PATCH 17/83] Collect all indices in indices.py |
Date: |
Tue, 25 Feb 2014 21:58:00 +0200 |
From: Praveen Kumar <address@hidden>
---
mediagoblin/plugins/search/indices.py | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100644 mediagoblin/plugins/search/indices.py
diff --git a/mediagoblin/plugins/search/indices.py
b/mediagoblin/plugins/search/indices.py
new file mode 100644
index 0000000..c329961
--- /dev/null
+++ b/mediagoblin/plugins/search/indices.py
@@ -0,0 +1,23 @@
+import logging
+
+from mediagoblin.db.models import MediaEntry
+
+from mediagoblin.plugins.search import schemas
+from mediagoblin.plugins.search.base import SearchIndex
+from mediagoblin.plugins.search import registry
+
+_log = logging.getLogger(__name__)
+
+media_entry_search_index = SearchIndex(
+ model = MediaEntry,
+ schema = schemas.MediaEntryIndexSchema,
+)
+
+
+def register_indices():
+ registry.IndexRegistry.register(media_entry_search_index)
+ _log.info("Registered %(index_name)s index for %(model_name)s"%({
+ 'index_name': media_entry_search_index.__class__.__name__,
+ 'model_name': MediaEntry.__class__.__name__}))
+
+
--
1.8.5.3
- [GMG-Devel] [PATCH 07/83] Fix imports and other bugs in indices.py, (continued)
- [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, 2014/02/25
- [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 <=
- [GMG-Devel] [PATCH 18/83] Add method to create a document from a model instance, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 19/83] Add event listeners for tracking ORM events for indices., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 20/83] Register indices and orm events for search., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 21/83] Fix bugs and add search method in SearchIndex, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 23/83] Add ORMEventsListener class to implement the ORM Events, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 22/83] Add ListenerRegistry class to collect all the listeners., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 24/83] Correct indentations in search.__init__, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 25/83] Add search forms., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 26/83] Add view to handle search queries., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 27/83] Add html template for search page., Alon Levy, 2014/02/25