mirror of https://github.com/apache/lucene.git
LUCENE-4333: Fixed bug caused by previous commit.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1378568 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
660e880347
commit
d447b1ae51
|
@ -244,9 +244,6 @@ public abstract class TermGroupFacetCollector extends AbstractGroupFacetCollecto
|
|||
segmentTotalCount = 0;
|
||||
|
||||
segmentGroupedFacetHits.clear();
|
||||
if (facetFieldDocTermOrds.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
for (GroupedFacetHit groupedFacetHit : groupedFacetHits) {
|
||||
int groupOrd = groupFieldTermsIndex.binarySearchLookup(groupedFacetHit.groupValue, spare);
|
||||
if (groupOrd < 0) {
|
||||
|
|
|
@ -239,6 +239,7 @@ public class GroupFacetCollectorTest extends AbstractGroupingTestCase {
|
|||
addField(doc, "x", "x", useDv);
|
||||
w.addDocument(doc);
|
||||
|
||||
// 1
|
||||
doc = new Document();
|
||||
addField(doc, groupField, "a", useDv);
|
||||
addField(doc, "airport", "ams", useDv);
|
||||
|
@ -247,28 +248,16 @@ public class GroupFacetCollectorTest extends AbstractGroupingTestCase {
|
|||
w.commit();
|
||||
w.deleteDocuments(new TermQuery(new Term("airport", "ams")));
|
||||
|
||||
// 0
|
||||
doc = new Document();
|
||||
addField(doc, groupField, "a", useDv);
|
||||
addField(doc, "airport", "ams", useDv);
|
||||
w.addDocument(doc);
|
||||
|
||||
// 1
|
||||
doc = new Document();
|
||||
addField(doc, groupField, "a", useDv);
|
||||
addField(doc, "airport", "dus", useDv);
|
||||
w.addDocument(doc);
|
||||
|
||||
// 2
|
||||
doc = new Document();
|
||||
addField(doc, groupField, "b", useDv);
|
||||
addField(doc, groupField, "a", useDv);
|
||||
addField(doc, "airport", "ams", useDv);
|
||||
w.addDocument(doc);
|
||||
|
||||
// 3
|
||||
doc = new Document();
|
||||
addField(doc, groupField, "b", useDv);
|
||||
addField(doc, "airport", "ams", useDv);
|
||||
addField(doc, groupField, "a", useDv);
|
||||
addField(doc, "airport", "dus", useDv);
|
||||
w.addDocument(doc);
|
||||
|
||||
// 4
|
||||
|
@ -277,7 +266,25 @@ public class GroupFacetCollectorTest extends AbstractGroupingTestCase {
|
|||
addField(doc, "airport", "ams", useDv);
|
||||
w.addDocument(doc);
|
||||
|
||||
// 5
|
||||
doc = new Document();
|
||||
addField(doc, groupField, "b", useDv);
|
||||
addField(doc, "airport", "ams", useDv);
|
||||
w.addDocument(doc);
|
||||
|
||||
// 6
|
||||
doc = new Document();
|
||||
addField(doc, groupField, "b", useDv);
|
||||
addField(doc, "airport", "ams", useDv);
|
||||
w.addDocument(doc);
|
||||
w.commit();
|
||||
|
||||
// 7
|
||||
doc = new Document();
|
||||
addField(doc, "x", "x", useDv);
|
||||
w.addDocument(doc);
|
||||
w.commit();
|
||||
|
||||
w.close();
|
||||
IndexSearcher indexSearcher = new IndexSearcher(DirectoryReader.open(dir));
|
||||
AbstractGroupFacetCollector groupedAirportFacetCollector = createRandomCollector(groupField, "airport", null, true, useDv);
|
||||
|
|
Loading…
Reference in New Issue