richie
richie copied to clipboard
🔧(search) add elastic search client custom settings
Add settings that permit to configure elastic search client with custom configuration like custom timeouts.
@sampaccoud I've addeed a new function new_elasticsearch_client
so it is possible to test the ES_CLIENT
initialization. Nevertheless, I've removed the custom initialization of all the connections to the elasticsearch (all the calls to the ES_INDICES_CLIENT
with custom kwargs). So this PR is more specific to resolve the problem.
So each installation can increase the overall timeout to the elasticsearch.
During meeting with @sampaccoud we have decided that I'm going to use the Django AppConfig https://github.com/openfun/richie/blob/master/src/richie/apps/search/apps.py , with the ready method to load other ES_CLIENT object. The ES_CLIENT
that it's defined in the apps/search/__init__.py
should be initialized within a function that can be overwritten on subsequent richie-site-factories.