in opbeans/tasks.py [0:0]
def sync_customers():
customer_docs = []
for customer in models.Customer.objects.annotate(total_orders=m.Count('orders')).order_by('pk')[50:]:
customer_docs.append(documents.Customer(**customer.to_search()).to_dict(include_meta=True))
bulk(connections.get_connection(), customer_docs)