Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 41745 invoked from network); 8 Feb 2008 17:17:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Feb 2008 17:17:56 -0000 Received: (qmail 66338 invoked by uid 500); 8 Feb 2008 17:17:39 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 66317 invoked by uid 500); 8 Feb 2008 17:17:39 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 66295 invoked by uid 99); 8 Feb 2008 17:17:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Feb 2008 09:17:39 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 194.109.24.28 is neither permitted nor denied by domain of karl.wettin@gmail.com) Received: from [194.109.24.28] (HELO smtp-vbr8.xs4all.nl) (194.109.24.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Feb 2008 17:17:09 +0000 Received: from kodapan.lan (memnon.xs4all.nl [82.93.70.124]) by smtp-vbr8.xs4all.nl (8.13.8/8.13.8) with ESMTP id m18HHFkq018130 for ; Fri, 8 Feb 2008 18:17:15 +0100 (CET) (envelope-from karl.wettin@gmail.com) Message-Id: <198EF845-819A-48EF-ADE2-DEA45CBF9916@gmail.com> From: Karl Wettin To: java-user@lucene.apache.org In-Reply-To: <46CBB02C-726E-470B-BE30-FCB5BD2EAA21@theronge.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Subject: Re: Faceting with payloads Date: Fri, 8 Feb 2008 18:17:14 +0100 References: <46CBB02C-726E-470B-BE30-FCB5BD2EAA21@theronge.com> X-Mailer: Apple Mail (2.915) X-Virus-Scanned: by XS4ALL Virus Scanner X-Virus-Checked: Checked by ClamAV on apache.org 6 feb 2008 kl. 23.10 skrev Matt Ronge: > I may index the token "house" maybe found in different places with > different types. If the user query contains house, I want to report > the number of instances of the token house of type A, type B and so > on. > > Should I be using payloads for this? If so, I'd like to be able to > count up all the instances of for each type. Then I can show the > results, along with TypeA (100 hits), TypeB (1000 hits) so on. Pehaps, what do you do with these numbers you extract? > If I could use something like HitCollector that was passed in the > token payload, that would be perfect, but it doesn't support that. > Any thoughts on how to go about this? Also, if I want to only allow > tokens of TypeB, how can I efficiently filter by TypeB; using a > Similarity subclass seems like a hack. I think you will have to hack the Query classes you want to use, and make their Weight share some counter thingy you can inspect after invoking a Query in the Searcher. But I'm not sure. karl --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org