
Lucene 4 Cookbook
By :

We have seen how an IndexWriter is obtained just by simply initialized with an Analyzer and IndexWriterConfig
. The default initialization behavior usually works well for the majority of the time. However, there may be situations where you need finer control during the initialization sequence. For example, when the default behavior creates a new index if an existing index doesn't exist already. This may not be ideal in a production environment where an index should always exist. Generating a new index will automatically hide the issue that an index is missing. Perhaps there was a glitch in the backup routine where it accidentally removed the index, or there was a data corruption issue that somehow wiped out the index directory. In any case, it would be beneficial if we are aware of the indexing status and alerted when issues are detected.
Lucene does provide options to control how an index is opened. We will talk about each option in detail in this section and show...
Change the font size
Change margin width
Change background colour