javanna commented on a change in pull request #639:
URL: https://github.com/apache/lucene/pull/639#discussion_r797660275
##########
File path: lucene/core/src/test/org/apache/lucene/search/TestBooleanQuery.java
##########
@@ -492,33 +493,43 @@ private void assertSameScoresWithoutFilters(IndexSearcher
searcher, BooleanQuery
final AtomicBoolean matched = new AtomicBoolean();
searcher.search(
bq,
- new SimpleCollector() {
- int docBase;
- Scorable scorer;
-
+ new CollectorManager<SimpleCollector, Boolean>() {
@Override
- protected void doSetNextReader(LeafReaderContext context) throws
IOException {
- super.doSetNextReader(context);
- docBase = context.docBase;
- }
-
- @Override
- public ScoreMode scoreMode() {
- return ScoreMode.COMPLETE;
+ public SimpleCollector newCollector() {
+ return new SimpleCollector() {
+ int docBase;
+ Scorable scorer;
+
+ @Override
+ protected void doSetNextReader(LeafReaderContext context) throws
IOException {
+ super.doSetNextReader(context);
+ docBase = context.docBase;
+ }
+
+ @Override
+ public ScoreMode scoreMode() {
+ return ScoreMode.COMPLETE;
+ }
+
+ @Override
+ public void setScorer(Scorable scorer) {
+ this.scorer = scorer;
Review comment:
these implementations of scoreMode and setScorer seem quite common, I
wonder if it'd make sense to extract it out to a base test collector within
test framework, of maybe it is overkill?
--
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]