Caa52 commented on a change in pull request #529:
URL: https://github.com/apache/solr/pull/529#discussion_r787215152
##########
File path: solr/core/src/test/org/apache/solr/search/TestFilteredDocIdSet.java
##########
@@ -127,22 +130,49 @@ public void testNullDocIdSet() throws Exception {
IndexSearcher searcher = newSearcher(reader);
Assert.assertEquals(1, searcher.search(new MatchAllDocsQuery(),
10).totalHits.value);
- // Now search w/ a Filter which returns a null DocIdSet
- Filter f = new Filter() {
+ // Now search w/ a Query which returns a null DocIdSet
+ Query f = new Query() {
@Override
- public DocIdSet getDocIdSet(LeafReaderContext context, Bits acceptDocs) {
- return null;
+ public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode,
float boost) {
+ return new Weight(this) {
+
+ @Override
+ public Explanation explain(LeafReaderContext context, int doc)
throws IOException {
+ final Scorer scorer = scorer(context);
+ final boolean match = (scorer != null &&
scorer.iterator().advance(doc) == doc);
+ if (match) {
+ assert scorer.score() == 0f;
+ return Explanation.match(0f, "Match on id " + doc);
Review comment:
Yes, I agree. I will have that fixed. Thanks for pointing it out!
--
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]