init: interpret batch-size 0 as 'default'

This makes writing tests easier.
This commit is contained in:
Dirk-Jan C. Binnema 2023-12-29 21:40:02 +02:00
parent f3f4ea65ab
commit ae4f49cfc0
2 changed files with 5 additions and 4 deletions

View File

@ -55,12 +55,13 @@ number of changes after which they are committed to the database; decreasing
this reduces the memory requirements, but make indexing substantially slows (and
vice-versa for increasing). Usually, the default of 250000 should be fine.
Batch-size 0 is interpreted as 'use the default'.
** --support-ngrams
whether to enable support for using ngrams in indexing and query parsing; this
can be useful for languages without explicit word-breaks, such as
Chinese/Japanes/Korean. See *NGRAM SUPPORT* below.
can be useful for languages without explicit word breaks, such as
Chinese/Japanese/Korean. See *NGRAM SUPPORT* below.
** --reinit

View File

@ -49,7 +49,7 @@ Mu::mu_cmd_init(const Options& opts)
if (opts.init.max_msg_size)
conf.set<Config::Id::MaxMessageSize>(*opts.init.max_msg_size);
if (opts.init.batch_size)
if (opts.init.batch_size && *opts.init.batch_size != 0)
conf.set<Config::Id::BatchSize>(*opts.init.batch_size);
if (!opts.init.my_addresses.empty())
conf.set<Config::Id::PersonalAddresses>(opts.init.my_addresses);