Re: Lucene 4 - Faceted Search with Sorting

2013-08-02 Thread Shai Erera
Hi Basically, every IndexSearch.search() variant has a matching Collector. They are there for easier usage by users. TopFieldCollector.create() takes searchAfter (TopFieldDoc), so you can use it in conjunction with FacetsCollector as I've outlined before. In general you're right that for paginati

Re: Lucene 4 - Faceted Search with Sorting

2013-08-01 Thread Sanket Paranjape
Hi Shai, Thanks for helping out. It worked. :) I also want to add pagination feature. This can be done via searchAfter method in IndexSearcher. But, this does not have Collector (I want facets from this). I think this has been done intentionally because facets would remain same while pagin

Re: Lucene 4 - Faceted Search with Sorting

2013-08-01 Thread Shai Erera
Hi You should do the following: TopFieldCollector tfc = TopFieldCollector.create(); FacetsCollector fc = FacetsCollector.create(); searcher.search(query, MultiCollector.wrap(tfc, fc)); Basically IndexSearcher.search(..., Sort) creates TopFieldCollector internally, so you need to create it outsid