Ejemplo n.º 1
0
def reindex(ctx):
    """
    Reindex all annotations.

    Creates a new search index from the data in PostgreSQL and atomically
    updates the index alias. This requires that the index is aliased already,
    and will raise an error if it is not.
    """

    os.environ['ELASTICSEARCH_CLIENT_TIMEOUT'] = '30'

    request = ctx.obj['bootstrap']()

    indexer.reindex(request.db, request.es, request)
Ejemplo n.º 2
0
def reindex(ctx):
    """
    Reindex all annotations.

    Creates a new search index from the data in PostgreSQL and atomically
    updates the index alias. This requires that the index is aliased already,
    and will raise an error if it is not.
    """
    os.environ["ELASTICSEARCH_CLIENT_TIMEOUT"] = "30"

    request = ctx.obj["bootstrap"]()

    es_client = request.es

    es_server_version = es_client.conn.info()["version"]["number"]
    click.echo("reindexing into Elasticsearch {} cluster".format(es_server_version))

    indexer.reindex(request.db, es_client, request)
Ejemplo n.º 3
0
def reindex(ctx):
    """
    Reindex all annotations.

    Creates a new search index from the data in PostgreSQL and atomically
    updates the index alias. This requires that the index is aliased already,
    and will raise an error if it is not.
    """
    os.environ['ELASTICSEARCH_CLIENT_TIMEOUT'] = '30'

    request = ctx.obj['bootstrap']()

    es_client = request.es

    es_server_version = es_client.conn.info()['version']['number']
    click.echo('reindexing into Elasticsearch {} cluster'.format(es_server_version))

    indexer.reindex(request.db, es_client, request)
Ejemplo n.º 4
0
Archivo: search.py Proyecto: kaydoh/h
def reindex(ctx):
    """
    Reindex all annotations.

    Creates a new search index from the data in PostgreSQL and atomically
    updates the index alias. This requires that the index is aliased already,
    and will raise an error if it is not.
    """
    os.environ["ELASTICSEARCH_CLIENT_TIMEOUT"] = "30"

    request = ctx.obj["bootstrap"]()

    es_client = request.es

    es_server_version = es_client.conn.info()["version"]["number"]
    click.echo(f"reindexing into Elasticsearch {es_server_version} cluster")

    indexer.reindex(request.db, es_client, request)
Ejemplo n.º 5
0
def reindex(ctx, es6):
    """
    Reindex all annotations.

    Creates a new search index from the data in PostgreSQL and atomically
    updates the index alias. This requires that the index is aliased already,
    and will raise an error if it is not.

    Reindex into the Elasticsearch 1 cluster by default, unless the `--es6`
    flag is set.
    """
    os.environ['ELASTICSEARCH_CLIENT_TIMEOUT'] = '30'

    request = ctx.obj['bootstrap']()

    if es6:
        es_client = request.es6
    else:
        es_client = request.es

    es_server_version = es_client.conn.info()['version']['number']
    click.echo('reindexing into Elasticsearch {} cluster'.format(es_server_version))

    indexer.reindex(request.db, es_client, request)