On Nov 14, 2007 6:44 AM, Mike Klaas <[EMAIL PROTECTED]> wrote: > > An implementation might look like: > > DocList superlist; > int facetDocLimit = params.getInt(DMP.FACET_DOCLIMIT, -1); > if(facetDocLimit > 0 && facetDocLimit != req.getLimit()) { > superlist = s.getDocList(query, restrictions, > SolrPluginUtils.getSort(req), > req.getStart(), facetDocLimit, > flags); > results.docSet = SearcherUtils.getDocSetFromDocList > (superlist, s); > results.docList = superlist.subset(0, req.getLimit()); > } else { > > Where getDocSetFromDocList() uses DocSetHitCollector to build a DocSet. > > To answer the performance question: There is a gain to be had when > doing lots of faceting on huge indices, if N is low (say, 500-1000). > One problem with the implementation above is that it stymies the > query caching in SolrIndexSearcher (since the generated DocList is > > the cache upper bound). > > -Mike
Thanks Mike, that looks like a good place to start. While I really can't think of any practical use for limiting the size of DocSet other than simple faceting, the new search component architecture make it a little more difficult to confine any implementation to only the facet component (unless there is an efficient way to obtain a subset of a DocSet, which there doesn't seem to be). I'm also aware of the query caching issues arising from SolrIndexSearcher however if N is sufficiently low this (hopefully) shouldn't be too much of a problem. I can't find either the SearcherUtils class nor any reference to a getDocSetFromDocList() method in svn trunk, is this deprecated or custom-build code? -Piete