Web / Apache Lucene Interview questions
What is the difference between IndexWriter and IndexWriterConfig?
These two classes split responsibility between action and configuration. IndexWriter is the object that actually performs the work - adding, updating, and deleting documents, and coordinating merges and commits.
IndexWriterConfig is a settings object handed to the IndexWriter's constructor, controlling things like which Analyzer to use, the RAM buffer size before flushing, the MergePolicy, similarity implementation, and the OpenMode (create, append, or create-or-append).
Because configuration is set once at construction and mostly immutable afterward, a common pattern is building an IndexWriterConfig carefully up front - tuned for the workload - then reusing a single long-lived IndexWriter built from it for the life of the application.
More Related questions...