Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 12804 invoked from network); 15 Mar 2011 08:22:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Mar 2011 08:22:53 -0000 Received: (qmail 21247 invoked by uid 500); 15 Mar 2011 08:22:52 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 21182 invoked by uid 500); 15 Mar 2011 08:22:51 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 21175 invoked by uid 99); 15 Mar 2011 08:22:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Mar 2011 08:22:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Mar 2011 08:22:51 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 2C3E23AACC6 for ; Tue, 15 Mar 2011 08:22:30 +0000 (UTC) Date: Tue, 15 Mar 2011 08:22:30 +0000 (UTC) From: "Bill Bell (JIRA)" To: dev@lucene.apache.org Message-ID: <810936765.3165.1300177350178.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <28920297.165171290038834148.JavaMail.jira@thor> Subject: [jira] Issue Comment Edited: (SOLR-2242) Get distinct count of names for a facet field MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SOLR-2242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006792#comment-13006792 ] Bill Bell edited comment on SOLR-2242 at 3/15/11 8:22 AM: ---------------------------------------------------------- I am going to use your suggestion. You will not have to set the limit. Getting the numFacetTerms will be optional, and you also will be able to NOT get the hgids as well. I propose this (please comment): This will ONLY output the numFacetTerms (no hgid facet counts): http://localhost:8983/solr/select?q=*:*&facet=true&facet.field=hgid&f.hgid.facet.numFacetTerms=1 This assumes the count will be limit=-1 {code} 7 {code} This will output the numFacetTerms AND hgid: http://localhost:8983/solr/select?q=*:*&facet=true&facet.field=hgid&facet.mincount=1&f.hgid.facet.numFacetTerms=2 {code} 7 1 1 1 1 1 5 1 {code} was (Author: billnbell): I am going to use your suggestion. You will not have to set the limit. Getting the numFacetTerms will be optional, and you also will be able to NOT get the hgids as well. I propose this (please comment): This will ONLY output the numFacetTerms (no hgid facet counts): http://localhost:8983/solr/select?q=*:*&facet=true&facet.field=hgid&f.hgid.facet.numfacetterms=1 This assumes the count will be limit=-1 {code} 7 {code} This will output the numFacetTerms AND hgid: http://localhost:8983/solr/select?q=*:*&facet=true&facet.field=hgid&facet.mincount=1&f.hgid.facet.numfacetterms=2 {code} 7 1 1 1 1 1 5 1 {code} > Get distinct count of names for a facet field > --------------------------------------------- > > Key: SOLR-2242 > URL: https://issues.apache.org/jira/browse/SOLR-2242 > Project: Solr > Issue Type: New Feature > Components: Response Writers > Affects Versions: 4.0 > Reporter: Bill Bell > Priority: Minor > Fix For: 4.0 > > Attachments: SOLR.2242.v2.patch > > > When returning facet.field= you will get a list of matches for distinct values. This is normal behavior. This patch tells you how many distinct values you have (# of rows). Use with limit=-1 and mincount=1. > The feature is called "namedistinct". Here is an example: > http://localhost:8983/solr/select?q=*:*&facet=true&facet.field=manu&facet.mincount=1&facet.limit=-1&f.manu.facet.namedistinct=0&facet.field=price&f.price.facet.namedistinct=1 > Here is an example on field "hgid" (without namedistinct): > {code} > - > - > 1 > 1 > 1 > 1 > 1 > 5 > 1 > > > {code} > With namedistinct (HGPY0000045FD36D4000A, HGPY00000FBC6690453A9, HGPY00001E44ED6C4FB3B, HGPY00001FA631034A1B8, HGPY00003317ABAC43B48, HGPY00003A17B2294CB5A, HGPY00003ADD2B3D48C39). This returns number of rows (7), not the number of values (11). > {code} > - > - > 7 > > > {code} > This works actually really good to get total number of fields for a group.field=hgid. Enjoy! -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org