Web / Apache Lucene Interview questions
What is the difference between NRT search and a normal commit?
Near Real-Time (NRT) search lets you open an IndexReader directly from an IndexWriter's in-memory state, seeing recently added documents in milliseconds - without going through a full, durable commit first.
A normal commit() fsyncs all segment files and writes a new segments_N commit point, which is what guarantees the data survives a crash or process restart. NRT readers skip that durability step to gain speed, meaning changes visible via NRT could still be lost if the process crashed before an actual commit happened.
In practice, applications combine both: use SearcherManager for frequent NRT refreshes so users see fresh content quickly, while still committing periodically (or on graceful shutdown) so that data is actually durable on disk.
More Related questions...