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]
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]
def test_index(self): with self.settings(ES_INDEXES={'website': 'websites'}): eq_(WebsiteIndexer.get_index(), 'websites')
def test_index(self): with self.settings(ES_INDEXES={'website': 'websites'}): eq_(WebsiteIndexer.get_index(), 'websites')
def test_index(self): with self.settings(ES_INDEXES={"website": "websites"}): eq_(WebsiteIndexer.get_index(), "websites")
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()])