Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 82450 invoked from network); 16 Dec 2005 15:58:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Dec 2005 15:58:59 -0000 Received: (qmail 9242 invoked by uid 500); 16 Dec 2005 15:58:52 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 9221 invoked by uid 500); 16 Dec 2005 15:58:52 -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 9210 invoked by uid 99); 16 Dec 2005 15:58:52 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Dec 2005 07:58:52 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of mike@curtin.com designates 205.158.62.199 as permitted sender) Received: from [205.158.62.199] (HELO ws6-3.us4.outblaze.com) (205.158.62.199) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 16 Dec 2005 07:58:48 -0800 Received: (qmail 28854 invoked from network); 16 Dec 2005 15:58:21 -0000 Received: from unknown (HELO ?10.1.1.2?) (mike@curtin.com@69.212.34.0) by ws6-3.us4.outblaze.com with SMTP; 16 Dec 2005 15:58:21 -0000 Message-ID: <43A2E41E.5040402@curtin.com> Date: Fri, 16 Dec 2005 10:58:22 -0500 From: "Michael D. Curtin" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: Re: How to retrieve distinct field matches? References: <3B9B3E0F-AC5D-43AC-BF45-4EB9EA9DD13A@gmail.com> <43A2205A.8080904@curtin.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Plat wrote: > Basically, pretend I do a regular search for "category:fiction". After > stemming/etc, this would match any Document with a category of > "fiction", "non-fiction", "fictitious", etc. All 900+ of them. > > BUT as far as the results are concerned, I'm not actually interested > in each Document that was hit, nor about any other field besides the > "category" field. I just want a list of the unique categories that > matched the search string of "fiction". > ... > Again, I want to find a *unique* list of "category" field values that > match certain query text. > > I know this can be done using a second index, but wanted to be sure > there isn't an obvious, less-hacky way first. I'm used to Lucene > surprising me with sneaky efficiencies. Ah, yes, I misunderstood what you are trying to do. How about doing a simple string search (like String.indexOf) on the contents of a TermEnum from IndexReader.terms()? Since you've only got a few thousand distinct values, that should be pretty fast. --MDC --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org