示例#1
0
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)
示例#2
0
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)
示例#3
0
文件: search.py 项目: scooley/osf.io
def update_user(user, index=None):
    index = index or settings.ELASTIC_INDEX
    search_engine.update_user(user, index=index)
示例#4
0
文件: search.py 项目: rmoorman/osf.io
def update_user(user, index=None):
    index = index or settings.ELASTIC_INDEX
    search_engine.update_user(user, index=index)
示例#5
0
    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
示例#6
0
文件: search.py 项目: adlius/osf.io
    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()
示例#7
0
def update_user(user):
    search_engine.update_user(user)
示例#8
0
文件: search.py 项目: lbanner/osf.io
def update_user(user):
    search_engine.update_user(user)
示例#9
0
def update_user(user, index=settings.ELASTIC_INDEX):
    search_engine.update_user(user, index=index)
示例#10
0
def update_user(user, index=settings.ELASTIC_INDEX):
    search_engine.update_user(user, index=index)