Ejemplo n.º 1
0
 def _get_doc_types(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_doc = WebappIndexer.get_mapping_type_name()
     site_doc = WebsiteIndexer.get_mapping_type_name()
     if doc_type == 'webapp':
         return [app_doc]
     elif doc_type == 'website':
         return [site_doc]
     return [app_doc, site_doc]
Ejemplo n.º 2
0
 def _get_doc_types(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_doc = WebappIndexer.get_mapping_type_name()
     site_doc = WebsiteIndexer.get_mapping_type_name()
     if doc_type == 'webapp':
         return [app_doc]
     elif doc_type == 'website':
         return [site_doc]
     return [app_doc, site_doc]
Ejemplo n.º 3
0
 def test_get_mapping_ok(self):
     eq_(WebsiteIndexer.get_mapping_type_name(), 'website')
     ok_(isinstance(self.indexer.get_mapping(), dict))
Ejemplo n.º 4
0
 def test_get_mapping_ok(self):
     eq_(WebsiteIndexer.get_mapping_type_name(), 'website')
     ok_(isinstance(self.indexer.get_mapping(), dict))
Ejemplo n.º 5
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()])