lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Høydahl (JIRA) <>
Subject [jira] Commented: (SOLR-2366) Facet Range Gaps
Date Fri, 18 Feb 2011 10:45:38 GMT


Jan Høydahl commented on SOLR-2366:

+1 for using absolute values instead of gap values
+1 for keeping the bucket spec as a separate param, including start and end
+1 for letting the start/end in the spec automatically disable hardend

I wrote down some thoughts the other day which is almost exactly what Hoss suggests, only
I called it facet.range.spec :) Was going to start another issue but now that the dicussion
is rolling here, here we go.

The facet.range.spec must be intuitive and should include start, all absolute boundaries and
end. Sample:

facet.range.spec=0,5,25,50,100,400 ==> 0-5, 5-25, 25-50, 50-100, 100-400.

To specify the gap size instead of next absolute threshold, we could have a +N syntax:
would be equivalent to the above absolute spec.

A +N value would repeat as many times as needed to reach the next absolute value:
facet.range.spec=0,5,+10,25,50,100,+100,400 ==> 0-5, 5-15, 15-25, 25-50, 50-100, 100-200,
200-300, 300-400
facet.range.spec=0,5,+10,25,50,100,+100,400 ==> 0-5, 5-15, 15-25, 25-50, 50-100, 100-200,
200-300, 300-400

Date example:
{code} a range before 2000, two 5-year ranges 2000-2005, 2005-2010, one range until start
of this year 2010-2011, then monthly ranges for this year until now.

Now, having all this power of defining buckets available, it would be easy to introduce (i.e.
feature creep :) a facet.range.labels param. Imagine:
facet.range.labels="Last month","This month","Yesterday","Today","This hour","Future"

> Facet Range Gaps
> ----------------
>                 Key: SOLR-2366
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Priority: Minor
>             Fix For: 3.2, 4.0
>         Attachments: SOLR-2366.patch, SOLR-2366.patch
> There really is no reason why the range gap for date and numeric faceting needs to be
evenly spaced.  For instance, if and when SOLR-1581 is completed and one were doing spatial
distance calculations, one could facet by function into 3 different sized buckets: walking
distance (0-5KM), driving distance (5KM-150KM) and everything else (150KM+), for instance.
 We should be able to quantize the results into arbitrarily sized buckets.  I'd propose the
syntax to be a comma separated list of sizes for each bucket.  If only one value is specified,
then it behaves as it currently does.  Otherwise, it creates the different size buckets. 
If the number of buckets doesn't evenly divide up the space, then the size of the last bucket
specified is used to fill out the remaining space (not sure on this)
> For instance,
> facet.range.start=0
> facet.range.end=400
> would yield buckets of:
> 0-5,5-30,30-80,80-180,180-280,280-380,380-400

This message is automatically generated by JIRA.
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message