Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 03439D3BB for ; Sun, 11 Nov 2012 22:35:17 +0000 (UTC) Received: (qmail 24455 invoked by uid 500); 11 Nov 2012 22:35:16 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 24269 invoked by uid 500); 11 Nov 2012 22:35:15 -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 24262 invoked by uid 99); 11 Nov 2012 22:35:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Nov 2012 22:35:15 +0000 Date: Sun, 11 Nov 2012 22:35:15 +0000 (UTC) From: "Bill Bell (JIRA)" To: dev@lucene.apache.org Message-ID: <690787645.98684.1352673315869.JavaMail.jiratomcat@arcas> In-Reply-To: <28920297.165171290038834148.JavaMail.jira@thor> Subject: [jira] [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=13495020#comment-13495020 ] Bill Bell edited comment on SOLR-2242 at 11/11/12 10:35 PM: ------------------------------------------------------------ uygar, You are not using it properly. SOLR-2242-3x_5_tests.patch does indeed work. http://x.x.x.x:8985/solr/ar1/select?shards=192.168.200.202:8985/solr/ar3/,192.168.200.202:8985/solr/ar4&q=hotels&group=true&group.field=site&facet=true&f.site.facet.numFacetTerms=1&facet.mincount=1&facet.limit=-1 You forgot the facet.field=site and the field is f.site.facet.numTerms=true With sample data. Do the following. Copy example to example2, and change jetty.xml on example2 to be port 8080. Run this: http://localhost:8983/solr/select?shards=localhost:8983/solr/,localhost:8080/solr/&q=*:*&rows=0&facet=true&facet.field=price&facet.numTerms=true&facet.mincount=1&facet.limit=-1 was (Author: billnbell): uygar, You are not using it properly. SOLR-2242-3x_5_tests.patch does indeed work. http://x.x.x.x:8985/solr/ar1/select?shards=192.168.200.202:8985/solr/ar3/,192.168.200.202:8985/solr/ar4&q=hotels&group=true&group.field=site&facet=true&f.site.facet.numFacetTerms=1&facet.mincount=1&facet.limit=-1 You forgot the facet.field=site With sample data. Do the following. Copy example to example2, and change jetty.xml on example2 to be port 8080. Run this: http://localhost:8983/solr/select?shards=localhost:8983/solr/,localhost:8080/solr/&q=*:*&rows=0&facet=true&facet.field=price&facet.numTerms=true&facet.mincount=1&facet.limit=-1 > 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-ALPHA > Reporter: Bill Bell > Priority: Minor > Fix For: 4.1 > > Attachments: SOLR-2242-3x_5_tests.patch, SOLR-2242-3x.patch, SOLR-2242.patch, SOLR-2242.patch, SOLR-2242.patch, SOLR-2242.shard.withtests.patch, SOLR-2242.solr3.1-fix.patch, SOLR-2242.solr3.1.patch, SOLR.2242.solr3.1.patch, SOLR-2242-solr40-3.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: > Parameters: > facet.numTerms or f..facet.numTerms = true (default is false) - turn on distinct counting of terms > facet.field - the field to count the terms > It creates a new section in the facet section... > http://localhost:8983/solr/select?shards=localhost:8983/solr,localhost:7574/solr&indent=true&q=*:*&facet=true&facet.mincount=1&facet.numTerms=true&facet.limit=-1&facet.field=price > http://localhost:8983/solr/select?shards=localhost:8983/solr,localhost:7574/solr&indent=true&q=*:*&facet=true&facet.mincount=1&facet.numTerms=false&facet.limit=-1&facet.field=price > http://localhost:8983/solr/select?shards=localhost:8983/solr,localhost:7574/solr&indent=true&q=*:*&facet=true&facet.mincount=1&facet.numTerms=true&facet.limit=-1&facet.field=price > This currently only works on facet.field. > {code} > > > ... > > > 14 > > > 14 > > > > > > OR with no sharding- > > 14 > > {code} > Several people use this to get the group.field count (the # of groups). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators 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