/** Returns the current value for this id, or null if the id isn't in the index or was deleted. */ public T get(String id) throws IOException { // First try to get the "live" value: T value = current.get(id); if (value == missingValue) { // Deleted but the deletion is not yet reflected in // the reader: return null; } else if (value != null) { return value; } else { value = old.get(id); if (value == missingValue) { // Deleted but the deletion is not yet reflected in // the reader: return null; } else if (value != null) { return value; } else { // It either does not exist in the index, or, it was // already flushed & NRT reader was opened on the // segment, so fallback to current searcher: S s = mgr.acquire(); try { return lookupFromSearcher(s, id); } finally { mgr.release(s); } } } }