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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to