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();
indexSearcher.search(query, MultiCollector.wrap(totalHitCountCollector,
facetCollector));
topDocs = new TopDocs(totalHitCountCollector.getTotalHits(), new
ScoreDoc[0], Float.NaN);
} else
topDocs = FacetsCollector.search(st.searcher, filterQuery, first +
limit,
facetCollector);
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:
http://lucene.472066.n3.nabble.com/Drill-down-facet-using-numhits-as-zero-tp4300838p4300845.html
Sent from the Lucene - Java Developer mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]