[ 
https://issues.apache.org/jira/browse/SOLR-7345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14529306#comment-14529306
 ] 

Mark Haase commented on SOLR-7345:
----------------------------------

The "Range Faceting" section doesn't mention "mincount" either, but "mincount" 
does work with range facets. In fact, lots of "Field-Value Faceting Parameters" 
work with "Range Faceting", even though they are not documented as such.

Rather than thinking of this as a feature request for range facets, please 
consider this a bug report for the documentation.

> Add support for facet.limit to range facets
> -------------------------------------------
>
>                 Key: SOLR-7345
>                 URL: https://issues.apache.org/jira/browse/SOLR-7345
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Mark Haase
>
> I have a field called post_date_tdt that I want to facet by month:
> {code}
> $ curl 
> 'http://myhost/solr/myapp/select/?defType=edismax&q=video&rows=0&start=0&wt=json&facet=true&facet.range=post_date_tdt&f.post_date_tdt.facet.mincount=200&f.post_date_tdt.facet.range.end=NOW%2FMONTH&f.post_date_tdt.facet.range.gap=%2B1MONTH&f.post_date_tdt.facet.range.start=NOW-120MONTHS%2FMONTH'
> {
>     "facet_counts": {
>         "facet_dates": {},
>         "facet_fields": {},
>         "facet_intervals": {},
>         "facet_queries": {},
>         "facet_ranges": {
>             "post_date_tdt": {
>                 "counts": [
>                     "2014-07-01T00:00:00Z",
>                     202,
>                     "2014-08-01T00:00:00Z",
>                     264,
>                     "2014-09-01T00:00:00Z",
>                     212,
>                     "2015-01-01T00:00:00Z",
>                     247
>                 ],
>                 "end": "2015-04-01T00:00:00Z",
>                 "gap": "+1MONTH",
>                 "start": "2005-04-01T00:00:00Z"
>             }
>         }
>     },
>     "response": {
>         "docs": [],
>         "numFound": 2432,
>         "start": 0
>     },
>     "responseHeader": {
>         "QTime": 3,
>         "params": {
>             "defType": "edismax",
>             "f.post_date_tdt.facet.mincount": "200",
>             "f.post_date_tdt.facet.range.end": "NOW/MONTH",
>             "f.post_date_tdt.facet.range.gap": "+1MONTH",
>             "f.post_date_tdt.facet.range.start": "NOW-120MONTHS/MONTH",
>             "facet": "true",
>             "facet.range": "post_date_tdt",
>             "q": "video",
>             "rows": "0",
>             "start": "0",
>             "wt": "json"
>         },
>         "status": 0
>     }
> }
> {code}
> So far, so good. But what if I want to limit my results to just the top 3 
> facets? Adding f.post_date_tdt_.facet.limit=3 doesn't have any effect.
> {code}
> curl 
> 'http://myhost/solr/myapp/select/?defType=edismax&q=video&rows=0&start=0&wt=json&facet=true&facet.range=post_date_tdt&f.post_date_tdt.facet.limit=3&f.post_date_tdt.facet.mincount=200&f.post_date_tdt.facet.range.end=NOW%2FMONTH&f.post_date_tdt.facet.range.gap=%2B1MONTH&f.post_date_tdt.facet.range.start=NOW-120MONTHS%2FMONTH'
> {
>     "facet_counts": {
>         "facet_dates": {},
>         "facet_fields": {},
>         "facet_intervals": {},
>         "facet_queries": {},
>         "facet_ranges": {
>             "post_date_tdt": {
>                 "counts": [
>                     "2014-07-01T00:00:00Z",
>                     202,
>                     "2014-08-01T00:00:00Z",
>                     264,
>                     "2014-09-01T00:00:00Z",
>                     212,
>                     "2015-01-01T00:00:00Z",
>                     247
>                 ],
>                 "end": "2015-04-01T00:00:00Z",
>                 "gap": "+1MONTH",
>                 "start": "2005-04-01T00:00:00Z"
>             }
>         }
>     },
>     "response": {
>         "docs": [],
>         "numFound": 2432,
>         "start": 0
>     },
>     "responseHeader": {
>         "QTime": 5,
>         "params": {
>             "defType": "edismax",
>             "f.post_date_tdt.facet.limit": "3",
>             "f.post_date_tdt.facet.mincount": "200",
>             "f.post_date_tdt.facet.range.end": "NOW/MONTH",
>             "f.post_date_tdt.facet.range.gap": "+1MONTH",
>             "f.post_date_tdt.facet.range.start": "NOW-120MONTHS/MONTH",
>             "facet": "true",
>             "facet.range": "post_date_tdt",
>             "q": "video",
>             "rows": "0",
>             "start": "0",
>             "wt": "json"
>         },
>         "status": 0
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to