[
https://issues.apache.org/jira/browse/SOLR-7345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hoss Man updated SOLR-7345:
---------------------------
Issue Type: Improvement (was: Bug)
Summary: Add support for facet.limit to range facets (was: Facet limit
doesn't work on range facets)
range faceting (and date faceting before it) have never supported facet.limit
-- nor has facet.limit ever been documented as something that *might* be
supported for range faceting -- it is explicitly listed as a "Field-Value
Faceting Parameters" (not a "Range Faceting" param)
edited jira to note this is a feature request, not a bug.
https://cwiki.apache.org/confluence/display/solr/Faceting#Faceting-Field-ValueFacetingParameters
> 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]