diff --git a/debian/koha-common.default b/debian/koha-common.default index 5c553e2b9f..bbe7524ab7 100644 --- a/debian/koha-common.default +++ b/debian/koha-common.default @@ -34,4 +34,27 @@ INDEXER_TIMEOUT=5 # # INDEXER_PARAMS="" +# Elasticsearch default options. Specifying the command line options to +# koha-elasticsearch will override these + +# Should biblios be indexed by default? +ES_INDEX_BIBLIOS="yes" +# Should authorities be indexed by default? +ES_INDEX_AUTHORITIES="yes" +# How many records should be batched for committing to elasticsearch at one time. You +# might want to decrease this if you're having issues with memory. +# Equivalent to '--commit' +ES_COMMIT_SIZE=5000 +# Now many parallel processes to use for indexing. If you have CPU +# cores to spare, this might be worth increasing. +# Equivalent to '--processes' +ES_NUMBER_OF_PROCESSES=1 +# Should the output be verbose by default? +# Equivalent to '--verbose' +ES_VERBOSE="no" +# A string that's supplied as a "where" query that can limit the records being idexed. +# You probably don't want to use this by default expect in some sort of special case. +# Equivalent to '--where' +#ES_WHERE_QUERY_SQL="" + ## End of general koha-common default options diff --git a/debian/scripts/koha-elasticsearch b/debian/scripts/koha-elasticsearch index e9a0a1ba10..5a9d6811a9 100755 --- a/debian/scripts/koha-elasticsearch +++ b/debian/scripts/koha-elasticsearch @@ -131,16 +131,25 @@ run_rebuild_elasticsearch() fi } -# Default parameters -biblios="yes" -authorities="yes" +# Default parameters from koha-common.default +biblios=$ES_INDEX_BIBLIOS # the 'only' variants are skipped because they don't actually control +authorities=$ES_INDEX_AUTHORITIES # anything and are just for setting stuff internally. +commit_size=$ES_COMMIT_SIZE +processes=$ES_NUMBER_OF_PROCESSES +verbose=$ES_VERBOSE +where=$ES_WHERE_QUERY_SQL + +# Default parameters if all else fails +: ${biblios:="yes"} +: ${authorities:="yes"} +: ${commit_size:=5000} +: ${processes:=1} +: ${verbose:="no"} +: ${where:=""} + biblios_only="no" authorities_only="no" -commit_size=5000 -processes=1 -verbose="no" op="" -where="" # Read parameters while [ -n "$*" ]; do