MCPcopy Create free account
hub / github.com/apache/solr / withSearcher

Method withSearcher

solr/core/src/java/org/apache/solr/core/SolrCore.java:2151–2159  ·  view source on GitHub ↗

Executes the lambda with the SolrIndexSearcher. This is more convenient than using #getSearcher() since there is no ref-counting business to worry about. Example: IndexReader reader = h.getCore().withSearcher(SolrIndexSearcher::getIndexReader); Wa

(IOFunction<SolrIndexSearcher, R> lambda)

Source from the content-addressed store, hash-verified

2149 return getSearcher(false, true, null);
2150 }
2151
2152 /**
2153 * Executes the lambda with the {@link SolrIndexSearcher}. This is more convenient than using
2154 * {@link #getSearcher()} since there is no ref-counting business to worry about. Example:
2155 *
2156 * <pre class="prettyprint">
2157 * IndexReader reader = h.getCore().withSearcher(SolrIndexSearcher::getIndexReader);
2158 * </pre>
2159 *
2160 * Warning: although a lambda is concise, it may be inappropriate to simply return the IndexReader
2161 * because it might be closed soon after this method returns; it really depends.
2162 */

Callers 15

getSegmentCountMethod · 0.95
getNumberOfReadersMethod · 0.80
assertNRTMethod · 0.80
getCoreCacheKeysMethod · 0.80
testMethod · 0.80
assertCompressionModeMethod · 0.80
testSearcherEventsMethod · 0.80
testSearcherEventsMethod · 0.80
testRegenerationMethod · 0.80

Calls 5

isReadyMethod · 0.95
getSearcherMethod · 0.95
applyMethod · 0.65
getMethod · 0.65
decrefMethod · 0.45

Tested by 15

getNumberOfReadersMethod · 0.64
assertNRTMethod · 0.64
getCoreCacheKeysMethod · 0.64
testMethod · 0.64
assertCompressionModeMethod · 0.64
testSearcherEventsMethod · 0.64
testSearcherEventsMethod · 0.64
testRegenerationMethod · 0.64