mirror of https://github.com/apache/lucene.git
Fixed build failure related to LUCENE-4333 changes.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1382610 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d74cb2ce43
commit
926277b304
|
@ -186,11 +186,23 @@ public abstract class TermGroupFacetCollector extends AbstractGroupFacetCollecto
|
|||
}
|
||||
|
||||
public void collect(int doc) throws IOException {
|
||||
int groupOrd = groupFieldTermsIndex.getOrd(doc);
|
||||
if (facetFieldDocTermOrds.isEmpty()) {
|
||||
int segmentGroupedFacetsIndex = groupOrd * (facetFieldDocTermOrds.numTerms() + 1);
|
||||
if (facetPrefix != null || segmentGroupedFacetHits.exists(segmentGroupedFacetsIndex)) {
|
||||
return;
|
||||
}
|
||||
|
||||
segmentTotalCount++;
|
||||
segmentFacetCounts[facetFieldDocTermOrds.numTerms()]++;
|
||||
|
||||
segmentGroupedFacetHits.put(segmentGroupedFacetsIndex);
|
||||
groupedFacetHits.add(
|
||||
new GroupedFacetHit(groupOrd == 0 ? null : groupFieldTermsIndex.lookup(groupOrd, new BytesRef()), null)
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
int groupOrd = groupFieldTermsIndex.getOrd(doc);
|
||||
if (facetOrdTermsEnum != null) {
|
||||
reuse = facetFieldDocTermOrds.lookup(doc, reuse);
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.apache.lucene.search.TermQuery;
|
|||
import org.apache.lucene.search.grouping.dv.DVGroupFacetCollector;
|
||||
import org.apache.lucene.search.grouping.term.TermGroupFacetCollector;
|
||||
import org.apache.lucene.store.Directory;
|
||||
import org.apache.lucene.store.FSDirectory;
|
||||
import org.apache.lucene.util.BytesRef;
|
||||
import org.apache.lucene.util._TestUtil;
|
||||
|
||||
|
@ -291,7 +292,7 @@ public class GroupFacetCollectorTest extends AbstractGroupingTestCase {
|
|||
indexSearcher.search(new MatchAllDocsQuery(), groupedAirportFacetCollector);
|
||||
TermGroupFacetCollector.GroupedFacetResult airportResult = groupedAirportFacetCollector.mergeSegmentResults(10, 0, false);
|
||||
assertEquals(3, airportResult.getTotalCount());
|
||||
assertEquals(0, airportResult.getTotalMissingCount());
|
||||
assertEquals(1, airportResult.getTotalMissingCount());
|
||||
|
||||
List<TermGroupFacetCollector.FacetEntry> entries = airportResult.getFacetEntries(0, 10);
|
||||
assertEquals(2, entries.size());
|
||||
|
|
Loading…
Reference in New Issue