def update_user(user, index=None, async_update=True): index = index or settings.ELASTIC_INDEX if async_update: user_id = user.id if settings.USE_CELERY: enqueue_task(search_engine.update_user_async.s(user_id, index=index)) else: search_engine.update_user_async(user_id, index=index) else: search_engine.update_user(user, index=index)
def update_user(user, index=None, async_update=True): index = index or settings.ELASTIC_INDEX if async_update: user_id = user.id if settings.USE_CELERY: enqueue_task( search_engine.update_user_async.s(user_id, index=index)) else: search_engine.update_user_async(user_id, index=index) else: search_engine.update_user(user, index=index)
def update_user(user, index=None): index = index or settings.ELASTIC_INDEX search_engine.update_user(user, index=index)
else: search_engine.update_contributors_async(user_id) @requires_search def update_user(user, index=None, async=True): index = index or settings.ELASTIC_INDEX if async: user_id = user.id if settings.USE_CELERY: enqueue_task( search_engine.update_user_async.s(user_id, index=index)) else: search_engine.update_user_async(user_id, index=index) else: search_engine.update_user(user, index=index) @requires_search def update_file(file_, index=None, delete=False): index = index or settings.ELASTIC_INDEX search_engine.update_file(file_, index=index, delete=delete) @requires_search def update_institution(institution, index=None): index = index or settings.ELASTIC_INDEX search_engine.update_institution(institution, index=index) @requires_search
if settings.USE_CELERY: enqueue_task(search_engine.update_contributors_async.s(user_id)) else: search_engine.update_contributors_async(user_id) @requires_search def update_user(user, index=None, async=True): index = index or settings.ELASTIC_INDEX if async: user_id = user.id if settings.USE_CELERY: enqueue_task(search_engine.update_user_async.s(user_id, index=index)) else: search_engine.update_user_async(user_id, index=index) else: search_engine.update_user(user, index=index) @requires_search def update_file(file_, index=None, delete=False): index = index or settings.ELASTIC_INDEX search_engine.update_file(file_, index=index, delete=delete) @requires_search def update_institution(institution, index=None): index = index or settings.ELASTIC_INDEX search_engine.update_institution(institution, index=index) @requires_search def delete_all(): search_engine.delete_all()
def update_user(user): search_engine.update_user(user)
def update_user(user, index=settings.ELASTIC_INDEX): search_engine.update_user(user, index=index)