ok, 
I'll try to answer this myself. Would this be correct to give me the data I 
need?
 
http://localhost:8080/solr-3.3.0/select/?
q=accountId:12345
&start=0
&rows=10
&indent=on
&facet=true
&facet.date=createdDate
&f.createdDate.facet.date.start=NOW/DAYS-1MONTHS
&f.createdDate.facet.date.end=NOW
&f.createdDate.facet.date.gap=%2b1MONTH
&facet.field=isClosed
&facet.mincount=1

 

> From: kenh...@hotmail.co.uk
> To: solr-user@lucene.apache.org
> Subject: Newbie: document count and facets
> Date: Mon, 10 Oct 2011 14:47:07 +0100
> 
> 
> hello,
> I'm quite new to Solr and are trying to get a grip on it all. I'm currently 
> reading and enjoying the "Solr 1.4 Enterprise Search Server" book. I'm trying 
> and failing and need some advise on the following.
> 
> given the following schema for "subscriptions"
> 
> <schema name="example" version="1.1">
> <types>
> <fieldType name="string" class="solr.StrField" sortMissingLast="true" 
> omitNorms="true"/>
> <fieldType name="date" class="solr.TrieDateField" omitNorms="true" 
> precisionStep="0" positionIncrementGap="0"/>
> <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" 
> omitNorms="true"/>
> </types>
> <fields>
> <field name="subscriptionId" type="string" indexed="true" stored="true" 
> multiValued="false" required="true"/>
> <field name="accountId" type="string" indexed="true" stored="true" 
> multiValued="false"/>
> <field name="isClosed" type="boolean" indexed="true" stored="true" 
> multiValued="false"/>
> <field name="createdDate" type="date" indexed="true" stored="true" 
> multiValued="false"/>
> </fields>
> <uniqueKey>subscriptionId</uniqueKey>
> </schema>
> 
> I would like to group per accountId, and facet the isClosed per accountId. In 
> addition, I would like to see the number of created subscriptions since a 
> given date. Would that be possible? I just can't figure out how to do the 
> grouping...
> 
> Something like this:
> 
> Number of subscriptions for accountId 12345: 100
> Created subscriptions since 01/01/2011: 70 
> Closed subscriptions: 10
> 
> any advise would be highly appreciated
> 
> regards,
> Kenneth 
                                          

Reply via email to