Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 98280 invoked from network); 11 Jul 2008 18:45:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jul 2008 18:45:24 -0000 Received: (qmail 56674 invoked by uid 500); 11 Jul 2008 18:45:18 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 56639 invoked by uid 500); 11 Jul 2008 18:45:18 -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 56628 invoked by uid 99); 11 Jul 2008 18:45:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Jul 2008 11:45:18 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [69.55.225.129] (HELO ehatchersolutions.com) (69.55.225.129) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Jul 2008 18:44:26 +0000 Received: by ehatchersolutions.com (Postfix, from userid 504) id 7692F30EFC19; Fri, 11 Jul 2008 12:44:48 -0600 (MDT) X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on javelina X-Spam-Level: Received: from [10.0.1.2] (va-69-68-189-198.dyn.embarqhsd.net [69.68.189.198]) by ehatchersolutions.com (Postfix) with ESMTP id 1B37F30EFC18 for ; Fri, 11 Jul 2008 12:44:40 -0600 (MDT) Message-Id: <703F6A06-67E6-464F-A69A-B497EA52F31F@ehatchersolutions.com> From: Erik Hatcher To: java-user@lucene.apache.org In-Reply-To: <608925.71308.qm@web50008.mail.re2.yahoo.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v924) Subject: Re: how to get total hit count for each Searchable? Date: Fri, 11 Jul 2008 14:44:35 -0400 References: <608925.71308.qm@web50008.mail.re2.yahoo.com> X-Mailer: Apple Mail (2.924) X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.1.1 On Jul 11, 2008, at 1:13 PM, xin liu wrote: > I have individual index files for Audio, Image and PDF files. We > build common meta fields for these different data types. When I > search for a string, I want the search to return mixed search > results from these 3 different index based on relevancy. So I use > ParallelMultiSearcher class to do the search. But I also wants to > know individual hit count for each individual index type. For > example, I want to get: > Mixed together total hit count: 103, with the first 10 HitItem. > Total hit in Audio: 73 > Total hit in Image: 17 > Total hit in PDF: 13 > > Right now, I'm doing the following way: > 1. Gets one Searchable instance for Audio, one for Image, and one > for PDF index; > 2. construct ParallelMultiSearcher s with above 3 Searchable as > parameters; call its search to get total hit count and first 10 hit > items; > 3. Call Audio searchable to get total hit count in Audio; > 4. Call Image searchable to get total hit count for Image; > 5. Call PDF searchable to get total hit count for Image. > > So, Lucene will need do 6 search operations for these 3 index. > Definitely, the performance will be an issue. > > Any better solution for this? Thanks! Solr - - features faceting along the lines of your needs. However, Solr does not currently support ParallelMultiSearcher, but it does support distributed searching across sharded Solr instances. Under the covers of Solr is simply a Lucene index. There's no reason Solr couldn't be enhanced to support ParallelMultiSearcher, I don't think, but right now it only uses a single file based IndexSearcher. Erik --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org