Fix #2039 by restoring auto Lucene index maintenance behind a setting

Fixes #2039