Add support to optionally regenerate database and index