Search code examples
solrlucenesolrj

Solr Facet Limit And Start Point


My question is straight forward : we can do limit in solr facets. Is it possible to set the start point as well in facet results?

Like we do in normal query :->

query.setRows(5);

query.setStart(3);

I want my facet results to be started, say from 4th point, not from very first result.

In a related note, this can be done when using groups. I can select which group I want by passing start point in query. But this doesn't seem possible with facets. Can't use Groups because there is no sort by numfound feature.


Solution

  • Faceting supports pagination using facet.offset and facet.limit.

    Using SolrJ, that should map to something like:

    query.setParam(FacetParam.FACET_LIMIT, "1000"); // default is 100
    query.setParam(FacetParam.FACET_OFFSET, "10"); // default is 0