You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to index using bulk index api in es.But index processing seems to get slower and slower even cause connection timeout.The next is my python code.
def bulk_index():
chunk = []
for count, doc in enumerate(doc_generator()):
id = doc.get('_id')
chunk.append({
'index': {
'_id': id
}
})
chunk.append(doc)
if (count + 1) % 10000 == 0:
assert len(chunk) == 20000
res = es.bulk(index='weibo', doc_type='user', body=chunk)
assert res['errors'] is False
print 'keke'
chunk = []
print 'docs total count: %s' % (count + 1)