示例#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)
示例#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)
示例#3
0
文件: service.py 项目: aliss/ALISS
 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()
示例#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)