def remove_from_organisation_index(self): connection = get_connection() return connection.delete(index='organisation_search', doc_type='organisation', id=self.id, refresh=True, ignore=404)
def add_to_organisation_index(self): connection = get_connection() return connection.index(index='organisation_search', doc_type='organisation', id=self.id, body=organisation_to_body(self), refresh=True)
def update_index(self): connection = get_connection() if self.is_published(): return connection.index(index='search', doc_type='service', id=self.id, body=service_to_body(self), refresh=True ) else: return self.remove_from_index()
def remove_from_index(self, connection=None): if connection == None: connection = get_connection() return connection.delete(index='search', doc_type='service', id=self.id, refresh=True, ignore=404)