def update_collection_status_in_search(collection_id):
 rights = rights_manager.get_collection_rights(collection_id)
 if (rights.status == rights_manager.ACTIVITY_STATUS_PRIVATE):
  delete_documents_from_search_index([collection_id])
 else:
  patch_collection_search_document(rights.id, _collection_rights_to_search_dict(rights))

def update_collection_status_in_search ( collection_id ) : rights = rights_manager . get_collection_rights ( collection_id ) if ( rights . status == rights_manager . ACTIVITY_STATUS_PRIVATE ) : delete_documents_from_search_index ( [ collection_id ] ) else : patch_collection_search_document ( rights . id , _collection_rights_to_search_dict ( rights ) )
updates the status field of a collection in the search index .