Hi Floyd, I don't think the feature that allows to use multiple gaps for a
range facet is committed. See
https://issues.apache.org/jira/browse/SOLR-2366
You can achieve a similar functionality by using facet.query. see:
http://wiki.apache.org/solr/SimpleFacetParameters#Facet_Fields_and_Facet_Queries

Regards,

Tomás
On Tue, Jul 26, 2011 at 1:23 AM, Floyd Wu <floyd...@gmail.com> wrote:

> Hi all,
>
> I need to make date faceted query and I tried to use facet.range but can't
> get result I need.
>
> I want to make 4 facet like following.
>
> 1 Months,3 Months, 6Months, more than 1 Year
>
> The onlinedate field in schema.xml like this
>
> <field name="onlinedate" type="tdate" indexed="true" stored="true"/>
>
> I hit the solr by this url
>
> http://localhost:8983/solr/select/?q=*%3A*
> &start=0
> &rows=10
> &indent=on
> &facet=true
> &facet.range=onlinedate
> &f.onlinedate.facet.range.start=NOW-1YEARS
> &f.onlinedate.facet.range.end=NOW%2B1YEARS
> &f.onlinedate.facet.range.gap=NOW-1MONTHS, NOW-3MONTHS,
> NOW-6MONTHS,NOW-1YEAR
>
> But the solr complained Exception during facet.range of onlinedate
> org.apache.solr.common.SolrException: Can't add gap NOW-1MONTHS,
> NOW-3MONTHS, NOW-6MONTHS,NOW-1YEAR to value Mon Jul 26 11:56:40 CST 2010
> for
> ....
>
> What is correct way to make this requirement to realized? Please help on
> this.
> Floyd
>

Reply via email to