Add an option to purge the search cache (see #6041)