I have a schema which has field Polarity which is of type "text" and it can have three values 0,1 or -1 and CreatedAt which is of type "date".

*How can I get count of polarity based on dates. For example, it gives the output that on 5/1/2011 there were 10 counts of 0, 10 counts of 1 and 10 counts of -1
*

If I use the facet query like this :-

http://localhost:8983/solor/select/?q=*:*&facet=true&facet.field=Polarity

Then I get the count of the complete database

<lstname="Polarity">
<intname="0">531477</int>
<intname="1">530682</int>
</lst>

The query : http://localhost:8983/solr/select/?q=*:*%20AND%20CreatedAt:[2011-03-10T00:00:00Z%20TO%202011-03-18T23:59:59Z]&facet=true&facet.date=CreatedAt&facet.date.start=2011-03-10T00:00:00Z&facet.date.end=2011-03-18T23:59:59Z&facet.date.gap=%2B1DAY <http://ec2-50-16-100-114.compute-1.amazonaws.com:8983/solr/select/?q=TweetData:*%20AND%20CreatedAt:[2011-03-10T00:00:00Z%20TO%202011-03-18T23:59:59Z]&facet=true&facet.date=CreatedAt&facet.date.start=2011-03-10T00:00:00Z&facet.date.end=2011-03-18T23:59:59Z&facet.date.gap=%2B1DAY>

Would give me the count of data per day, like this:

<lstname="CreatedAt">
<intname="2011-03-10T00:00:00Z">0</int>
<intname="2011-03-11T00:00:00Z">276262</int>
<intname="2011-03-12T00:00:00Z">183929</int>
<intname="2011-03-13T00:00:00Z">196853</int>
<intname="2011-03-14T00:00:00Z">2967</int>
<intname="2011-03-15T00:00:00Z">22762</int>
<intname="2011-03-16T00:00:00Z">11299</int>
<intname="2011-03-17T00:00:00Z">37433</int>
<intname="2011-03-18T00:00:00Z">14359</int>
<strname="gap">+1DAY</str>
<datename="start">2011-03-10T00:00:00Z</date>
<datename="end">2011-03-19T00:00:00Z</date>
</lst>

How will I be able to get the Polarity count for each date like:-

2011-03-10T00:00:00Z
    Polarity
        0 = 100
        1 = 500
        -1 = 200

--
Thanks&  Regards

Jasneet Sabharwal

Reply via email to