javanna commented on code in PR #787:
URL: https://github.com/apache/lucene/pull/787#discussion_r842786871
##########
lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/BooleanQueryTestFacade.java:
##########
@@ -121,14 +125,24 @@ public void doTest() throws Exception {
Query query = lq.makeLuceneQueryField(fieldName, qf);
/* if (verbose) System.out.println("Lucene: " + query.toString()); */
- TestCollector tc = new TestCollector();
- IndexReader reader = DirectoryReader.open(dBase.getDb());
- IndexSearcher searcher = new IndexSearcher(reader);
- try {
- searcher.search(query, tc);
- } finally {
- reader.close();
+ SetOnce<TestCollector> collector = new SetOnce<>();
+ try (IndexReader reader = DirectoryReader.open(dBase.getDb())) {
+ IndexSearcher searcher = new IndexSearcher(reader);
Review Comment:
no executor is set to the searcher, hence it does not seem worthwhile to
write a collector manager that handles concurrency. I am even wondering if
enforcing single thread through the setonce is worthwhile
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]