def METHOD_NAME(self):
    if self.process_id and self.search_raw_query:
        cursor = connection.cursor()
        try:
            sql = (
                'DROP MATERIALIZED VIEW IF EXISTS "{view_name}"'.
                format(
                    view_name=self.process_id
                ))
            cursor.execute('''%s''' % sql)
        except (ProgrammingError, DatabaseError):
            pass
        sql = (
            'CREATE MATERIALIZED VIEW "{view_name}" AS {sql_raw}'.
            format(
                view_name=self.process_id,
                sql_raw=self.search_raw_query
            ))
        cursor.execute('''%s''' % sql)