jpountz commented on code in PR #11840:
URL: https://github.com/apache/lucene/pull/11840#discussion_r997895966
##########
lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestFieldQuery.java:
##########
@@ -40,12 +41,23 @@
public class TestFieldQuery extends AbstractTestCase {
private float boost;
+ private IndexSearcher searcher;
/** Set boost to a random value each time it is called. */
private void initBoost() {
boost = usually() ? 1F : random().nextFloat() * 10000;
}
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ if (reader == null) {
+ searcher = null;
+ } else {
+ searcher = newSearcher(reader);
+ }
+ }
Review Comment:
Does it work? It looks like the reader is not instantiated in the setup, but
in some protected helper methods that run after the setup? Should we instead
modify the parent class to always instantiate an IndexSearcher when
instantiating a reader?
--
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]