2๐
โ
I would suggest using the official Elasticsearch python client: elasticsearch-py which has reliable connection handling, is thread safe etc. It is also faster (according to the author, who is part of the Elasticsearch team).
You can then have your es = Elasticsearch()
either at the top of your tasks.py
, or in e.g. core.helpers
and import es
from there.
๐คErve1879
Source:stackexchange.com