jpountz commented on a change in pull request #622:
URL: https://github.com/apache/lucene/pull/622#discussion_r794619428
##########
File path: lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java
##########
@@ -167,19 +168,36 @@ public void run() {
RandomPicks.randomFrom(
random(), new String[] {"blue", "red", "yellow",
"green"});
final Query q = new TermQuery(new Term("color", value));
- TotalHitCountCollector collector = new
TotalHitCountCollector();
- searcher.search(q, collector); // will use the cache
- final int totalHits1 = collector.getTotalHits();
- TotalHitCountCollector collector2 = new
TotalHitCountCollector();
- searcher.search(
- q,
- new FilterCollector(collector2) {
- @Override
- public ScoreMode scoreMode() {
- return ScoreMode.COMPLETE; // will not use the
cache because of scores
- }
- });
- final long totalHits2 = collector2.getTotalHits();
+ TotalHitCountCollectorManager collectorManager =
+ new TotalHitCountCollectorManager();
+ final int totalHits1 =
+ searcher.search(q, collectorManager); // will use the
cache
Review comment:
move comment to the previous line to avoid ugly formatting?
--
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]