Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 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()
Ejemplo n.º 4
0
 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)