SOLR-3062: join was ignoring acceptDocs

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1239355 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2012-02-01 22:02:07 +00:00
parent 3309fe9b30
commit fa11c89517
3 changed files with 11 additions and 1 deletions

View File

@ -303,6 +303,9 @@ Bug Fixes
* SOLR-3037: When using binary format in solrj the codec screws up parameters
(Sami Siren via yonik)
* SOLR-3062: A join in the main query was not respecting any filters pushed
down to it via acceptDocs since LUCENE-1536. (Mike Hugo, yonik)
Other Changes
----------------------

View File

@ -220,7 +220,8 @@ class JoinQuery extends Query {
filter = resultSet.getTopFilter();
}
DocIdSet readerSet = filter.getDocIdSet(context, null); // this set only includes live docs
// Although this set only includes live docs, other filters can be pushed down to queries.
DocIdSet readerSet = filter.getDocIdSet(context, acceptDocs);
if (readerSet == null) readerSet=DocIdSet.EMPTY_DOCIDSET;
return new JoinScorer(this, readerSet.iterator(), getBoost());
}

View File

@ -128,6 +128,12 @@ public class TestJoin extends SolrTestCaseJ4 {
"debugQuery","true"),
davesDepartments);
// find people that develop stuff - but limit via filter query to a name of "john"
// this tests filters being pushed down to queries (SOLR-3062)
assertJQ(req("q","{!join from=dept_id_s to=dept_s}text:develop", "fl","id", "fq", "name:john")
,"/response=={'numFound':1,'start':0,'docs':[{'id':'1'}]}"
);
}