[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
- [GMG-Devel] [PATCH 27/83] Add html template for search page., (continued)
- [GMG-Devel] [PATCH 27/83] Add html template for search page., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 28/83] Fix bugs, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 29/83] Add methods to interpret results by the SearchIndex object, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 30/83] fix parameters in search views, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 31/83] Refactor SearchIndex and add method to update an index., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 32/83] Add event listener for model update, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 33/83] Add listener for model delete event., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 34/83] Fix bugs in SearchIndex, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 35/83] Add indices for MediaEntry and MediaTag., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 36/83] Add schema for MediaTag., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 37/83] Register schemas for MediaEntry and MediaTag.,
Alon Levy <=
- [GMG-Devel] [PATCH 38/83] Add gmg command to delete all indices., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 39/83] Clean up and add docstring to search methods., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 40/83] Add try-except block to event listeners., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 42/83] Store attributes from a model only it its available., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 43/83] Add field for storing search results., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 41/83] Correct method names in event listeners, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 44/83] Remove the field for storing search results with the index., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 46/83] Add verbose_name and css_id to search results., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 47/83] Adapt results collection to change in result generation., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 48/83] Modify search template to show tabbed results., Alon Levy, 2014/02/25