(self)
Returns a reindexer that will return either all domains with case search
        enabled, or a single domain if passed in
Returns a reindexer that will return either all domains with case search
        enabled, or a single domain if passed in
Returns a reindexer that will return either all domains with case search enabled or a single domain if passed in
def build(self):
        """Returns a reindexer that will return either all domains with case search
        enabled, or a single domain if passed in
        """
        limit_to_db = self.options.pop('limit_to_db', None)
        domain = self.options.pop('domain', None)

        limit_db_aliases = [limit_to_db] if limit_to_db else None
        initialize_index_and_mapping(get_es_new(), CASE_SEARCH_INDEX_INFO)
        try:
            if domain is not None:
                if not domain_needs_search_index(domain):
                    raise CaseSearchNotEnabledException("{} does not have case search enabled".format(domain))
                domains = [domain]
            else:
                # return changes for all enabled domains
                domains = domains_needing_search_index()

            change_provider = get_domain_case_change_provider(domains=domains, limit_db_aliases=limit_db_aliases)
        except ProgrammingError:
            # The db hasn't been intialized yet, so skip this reindex and complain.
            return _fail_gracefully_and_tell_admins()
        else:
            return PillowChangeProviderReindexer(
                get_case_search_processor(),
                change_provider=change_provider,
            )
def build ( self ) : limit_to_db = self . options . pop ( 'limit_to_db' , None ) domain = self . options . pop ( 'domain' , None ) limit_db_aliases = [ limit_to_db ] if limit_to_db else None initialize_index_and_mapping ( get_es_new ( ) , CASE_SEARCH_INDEX_INFO ) try : if domain is not None : if not domain_needs_search_index ( domain ) : raise CaseSearchNotEnabledException ( "{} does not have case search enabled" . format ( domain ) ) domains = [ domain ] else : # return changes for all enabled domains domains = domains_needing_search_index ( ) change_provider = get_domain_case_change_provider ( domains = domains , limit_db_aliases = limit_db_aliases ) except ProgrammingError : # The db hasn't been intialized yet, so skip this reindex and complain. return _fail_gracefully_and_tell_admins ( ) else : return PillowChangeProviderReindexer ( get_case_search_processor ( ) , change_provider = change_provider , )