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)
| 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 | */ |