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]
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]
def test_get_mapping_ok(self): eq_(WebsiteIndexer.get_mapping_type_name(), 'website') ok_(isinstance(self.indexer.get_mapping(), dict))
def test_get_mapping_ok(self): eq_(WebsiteIndexer.get_mapping_type_name(), 'website') ok_(isinstance(self.indexer.get_mapping(), dict))
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()])