Sorry for wrong version of code :( below is the correct code 

FacetsCollector facetCollector = new FacetsCollector();
TopDocs topDocs = null;
TotalHitCountCollector totalHitCountCollector = null;
if (limit == 0) {
        totalHitCountCollector = new TotalHitCountCollector();, MultiCollector.wrap(totalHitCountCollector,
        topDocs = new TopDocs(totalHitCountCollector.getTotalHits(), new
ScoreDoc[0], Float.NaN);
} else
        topDocs =, filterQuery, first + 

Yes initially I was searching for search method same as in DrillSideways 
which takes query and collector but could not find one also I saw that it is
not possible to use FacetCollector search API since there is no provision of
having TotalHitCountCollector and because of which I wrote above code but
end result is not as per expected.

View this message in context:
Sent from the Lucene - Java Developer mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to