Ejemplo n.º 1
0
 def _get_indices(self):
     # Check if we are filtering by a doc_type (e.g., apps, sites).
     # Default to all content types.
     doc_type = self.request.GET.get('doc_type', 'all')
     app_index = WebappIndexer.get_index()
     site_index = WebsiteIndexer.get_index()
     if doc_type == 'webapp':
         return [app_index]
     elif doc_type == 'website':
         return [site_index]
     return [app_index, site_index]
Ejemplo n.º 2
0
 def _get_indices(self):
     # Check if we are filtering by a doc_type (e.g., apps, sites).
     # Default to all content types.
     doc_type = self.request.GET.get('doc_type', 'all')
     app_index = WebappIndexer.get_index()
     site_index = WebsiteIndexer.get_index()
     if doc_type == 'webapp':
         return [app_index]
     elif doc_type == 'website':
         return [site_index]
     return [app_index, site_index]
Ejemplo n.º 3
0
 def test_index(self):
     with self.settings(ES_INDEXES={'website': 'websites'}):
         eq_(WebsiteIndexer.get_index(), 'websites')
Ejemplo n.º 4
0
 def test_index(self):
     with self.settings(ES_INDEXES={'website': 'websites'}):
         eq_(WebsiteIndexer.get_index(), 'websites')
Ejemplo n.º 5
0
 def test_index(self):
     with self.settings(ES_INDEXES={"website": "websites"}):
         eq_(WebsiteIndexer.get_index(), "websites")
Ejemplo n.º 6
0
 def get_queryset(self):
     return Search(
         using=BaseIndexer.get_es(),
         index=[WebappIndexer.get_index(), WebsiteIndexer.get_index()],
         doc_type=[WebappIndexer.get_mapping_type_name(),
                   WebsiteIndexer.get_mapping_type_name()])