Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Comment: SolrCore.getRealtimeSearcher (#2610)

David Smiley18ec785e558d
diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.java
index 4c3d09980ca..354f5465ca3 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrCore.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java
@@ -2228,6 +2228,8 @@ public class SolrCore implements SolrInfoBean, Closeable {
* reference count will be incremented.
*/
public RefCounted<SolrIndexSearcher> getRealtimeSearcher() {
+ // In practice, this is nearly always the same as the non-realtime searcher because that one
+ // nearly always exists and it installs itself as the realtime searcher.
synchronized (searcherLock) {
if (realtimeSearcher != null) {
realtimeSearcher.incref();