exclude title and description

This commit is contained in:
Victor Shyba 2021-01-27 02:56:43 -03:00
parent 7295b7e329
commit 146b693e4a
2 changed files with 4 additions and 2 deletions

View file

@ -332,6 +332,7 @@ def expand_query(**kwargs):
"claim_name^4", "channel_name^8", "title^1", "description^.5", "author^1", "tags^.5"
]}}}
query = {
"_source": {"excludes": ["description", "title"]},
'query': {'bool': query},
"sort": [],
}

View file

@ -41,7 +41,7 @@ WHERE claim.rowid % {shards_total} = {shard_num}
async def consume(producer):
es = AsyncElasticsearch()
await async_bulk(es, producer)
await async_bulk(es, producer, request_timeout=120)
await es.close()
@ -50,7 +50,8 @@ async def run(args, shard):
index = SearchIndex('')
await index.start()
await index.stop()
await consume(get_all(db.cursor(), shard, args.clients))
producer = get_all(db.cursor(), shard, args.clients)
await asyncio.gather(*(consume(producer) for _ in range(min(8, args.clients))))
def __run(args, shard):
asyncio.run(run(args, shard))