Return-Path: X-Original-To: apmail-lucene-solr-user-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 447475AF1 for ; Thu, 12 May 2011 07:51:38 +0000 (UTC) Received: (qmail 13534 invoked by uid 500); 12 May 2011 07:51:35 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 13481 invoked by uid 500); 12 May 2011 07:51:35 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 13458 invoked by uid 99); 12 May 2011 07:51:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 May 2011 07:51:34 +0000 X-ASF-Spam-Status: No, hits=3.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,SPF_PASS,URI_HEX,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of SRS0=spmVyv=YC=ngicorporation.com=jasneet.sabharwal@yourhostingaccount.com designates 65.254.254.80 as permitted sender) Received: from [65.254.254.80] (HELO mailout06.yourhostingaccount.com) (65.254.254.80) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 May 2011 07:51:28 +0000 Received: from mailscan13.yourhostingaccount.com ([10.1.15.13] helo=mailscan13.yourhostingaccount.com) by mailout06.yourhostingaccount.com with esmtp (Exim) id 1QKQfq-0008Ps-Ln for solr-user@lucene.apache.org; Thu, 12 May 2011 03:51:06 -0400 Received: from impout02.yourhostingaccount.com ([10.1.55.2] helo=impout02.yourhostingaccount.com) by mailscan13.yourhostingaccount.com with esmtp (Exim) id 1QKQfq-0007yn-IY for solr-user@lucene.apache.org; Thu, 12 May 2011 03:51:06 -0400 Received: from authsmtp06.yourhostingaccount.com ([10.1.18.6]) by impout02.yourhostingaccount.com with NO UCE id iXqv1g00307rVmq0000000; Thu, 12 May 2011 03:50:55 -0400 X-EN-OrigOutIP: 10.1.18.6 X-EN-IMPSID: iXqv1g00307rVmq0000000 Received: from [117.199.214.240] (helo=[192.168.1.6]) by authsmtp06.yourhostingaccount.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim) id 1QKQfd-0003j1-4Q for solr-user@lucene.apache.org; Thu, 12 May 2011 03:50:55 -0400 Message-ID: <4DCB9155.4070507@ngicorporation.com> Date: Thu, 12 May 2011 13:20:45 +0530 From: Jasneet Sabharwal User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: solr-user@lucene.apache.org Subject: Re: Facet Count Based on Dates References: <4DC8F905.20301@ngicorporation.com> <1305022894797-2922541.post@n3.nabble.com> In-Reply-To: <1305022894797-2922541.post@n3.nabble.com> Content-Type: multipart/alternative; boundary="------------030600080404000300020707" X-EN-UserInfo: d3fc347c903aceebf3b374f4fed80fa1:e015c1ef10ab221725d8e46a8169441f X-EN-AuthUser: jasneet.sabharwal@ngicorporation.com Sender: Jasneet Sabharwal X-EN-OrigIP: 117.199.214.240 X-EN-OrigHost: unknown --------------030600080404000300020707 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit But Pivot Faceting is a feature of Solr 4.0 and I am using 3.1 as that is a stable built and cant use a a Nightly Build. The question was: - 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 531477 530682 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 Would give me the count of data per day, like this: 0 276262 183929 196853 2967 22762 11299 37433 14359 +1DAY 2011-03-10T00:00:00Z 2011-03-19T00:00:00Z 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 2011-03-11T00:00:00Z Polarity 0=100 1=500 -1=200 And so on till the date range ends. On 10-05-2011 15:51, Grijesh wrote: > Have you looked at Pivot Faceting > http://wiki.apache.org/solr/HierarchicalFaceting > http://wiki.apache.org/solr/SimpleFacetParameters#Pivot_.28ie_Decision_Tree.29_Faceting-1 > > ----- > Thanx: > Grijesh > www.gettinhahead.co.in > -- > View this message in context: http://lucene.472066.n3.nabble.com/Facet-Count-Based-on-Dates-tp2922371p2922541.html > Sent from the Solr - User mailing list archive at Nabble.com. > -- Regards Jasneet Sabharwal Software Developer NextGen Invent Corporation +91-9871228582 --------------030600080404000300020707--