mediagoblin-devel
[Top][All Lists]
Advanced

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

[GMG-Devel] [PATCH 37/83] Register schemas for MediaEntry and MediaTag.


From: Alon Levy
Subject: [GMG-Devel] [PATCH 37/83] Register schemas for MediaEntry and MediaTag.
Date: Tue, 25 Feb 2014 21:58:20 +0200

From: Praveen Kumar <address@hidden>

---
 mediagoblin/plugins/search/__init__.py | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/mediagoblin/plugins/search/__init__.py 
b/mediagoblin/plugins/search/__init__.py
index c04956c..8be286d 100644
--- a/mediagoblin/plugins/search/__init__.py
+++ b/mediagoblin/plugins/search/__init__.py
@@ -19,9 +19,9 @@ import logging
 
 from mediagoblin.tools import pluginapi
 
-from mediagoblin.db.models import MediaEntry
+from mediagoblin.db.models import (MediaEntry, MediaTag)
 from mediagoblin.plugins.search import schemas
-from mediagoblin.plugins.search.base import SearchIndex
+from mediagoblin.plugins.search import indices
 from mediagoblin.plugins.search import registry
 from mediagoblin.plugins.search import listeners
 
@@ -31,7 +31,7 @@ PLUGIN_DIR = os.path.dirname(__file__)
 
 
 def register_indices():
-    media_entry_search_index = SearchIndex(
+    media_entry_search_index = indices.MediaEntrySearchIndex(
         model = MediaEntry,
         schema = schemas.MediaEntryIndexSchema,
     )
@@ -40,7 +40,15 @@ def register_indices():
     _log.info("Registered %(index_name)s index for %(model_name)s"%({
         'index_name': media_entry_search_index.__class__.__name__,
         'model_name': MediaEntry.__name__}))
-
+    
+    media_tag_search_index = indices.MediaTagSearchIndex(
+        model = MediaTag,
+        schema = schemas.MediaTagIndexSchema,
+    )
+    registry.IndexRegistry.register(media_tag_search_index)
+    _log.info("Registered %(index_name)s index for %(model_name)s"%({
+        'index_name': media_tag_search_index.__class__.__name__,
+        'model_name': MediaTag.__name__}))
 
 def activate_orm_events_listeners():
     indices = registry.IndexRegistry.indices()
-- 
1.8.5.3



reply via email to

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