Closed reginafcompton closed 4 years ago
You can configure a default batch size in the Haystack connection, like this:
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
'URL': 'http://solr:8983/solr/lametro',
'SILENTLY_FAIL': False, # Raise Solr errors
'BATCH_SIZE': 100, # Reduce the default batch size for index updates
},
}
We should add this to our Councilmatic template, but I don't think we need to bring this change in.
This PR contains two managements commands that override existing ones in Haystack:
update_index
andrebuild_index
. The new commands assign default values to the batch-size, so that humans can manually execute this command, without worrying about adding this argument.For this to work,
councilmatic_core
must be abouthaystack
insettings.py
: https://docs.djangoproject.com/en/2.1/howto/custom-management-commands/#overriding-commandsResponds to devops issue https://github.com/datamade/devops/issues/42
@evz and I discussed this already, but would appreciate your input @fgregg