Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 43594 invoked from network); 9 Feb 2007 14:09:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Feb 2007 14:09:55 -0000 Received: (qmail 1115 invoked by uid 500); 9 Feb 2007 14:09:54 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 1085 invoked by uid 500); 9 Feb 2007 14:09:54 -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 1074 invoked by uid 99); 9 Feb 2007 14:09:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Feb 2007 06:09:54 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of Sachin.Kainth@atkinsglobal.com designates 217.79.216.190 as permitted sender) Received: from [217.79.216.190] (HELO cluster-e.mailcontrol.com) (217.79.216.190) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Feb 2007 06:09:41 -0800 Received: from SGBD012100.wsatkins.com ([193.117.24.24]) by rly49e.srv.mailcontrol.com (MailControl) with SMTP id l19E9DGm013936 for ; Fri, 9 Feb 2007 14:09:13 GMT Received: From SGBD012104.wsatkins.com ([10.202.26.18]) by SGBD012100.wsatkins.com (WebShield SMTP v4.5 MR2); id 1171030128219; Fri, 9 Feb 2007 14:08:48 +0000 Received: from SGBLOW2101.wsatkins.com ([10.22.33.30]) by SGBD012104.wsatkins.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 9 Feb 2007 14:08:48 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: categorisation Date: Fri, 9 Feb 2007 14:08:47 -0000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: categorisation Thread-Index: AcdMU5Oj61ltrrvsRRWO9Ia8R098QwAAC3MA References: <58D0497D-3CC2-4947-96D6-1D7ADE08828F@ehatchersolutions.com> <28F19771-D2FF-4B5B-811D-43936DF71ADF@ehatchersolutions.com> From: "Kainth, Sachin" To: X-OriginalArrivalTime: 09 Feb 2007 14:08:48.0131 (UTC) FILETIME=[D1545530:01C74C53] X-Scanned-By: MailControl A-06-00-00 (www.mailcontrol.com) on 10.69.0.159 X-Virus-Checked: Checked by ClamAV on apache.org Are you saying that without solr I will have caching problems under load?=20 -----Original Message----- From: Erik Hatcher [mailto:erik@ehatchersolutions.com]=20 Sent: 09 February 2007 14:06 To: java-user@lucene.apache.org Subject: Re: categorisation On Feb 9, 2007, at 7:07 AM, Kainth, Sachin wrote: > But does that not imply that a second search is made against the index > by the line: > > BitSet all =3D (new QueryFilter(q)).bits(reader) Yeah, if you want to return facet counts and results in the same sweep, yes. If all you want are the counts, only one query is needed. Caching is key. Solr - See the Light! Erik > > -----Original Message----- > From: Kainth, Sachin [mailto:Sachin.Kainth@atkinsglobal.com] > Sent: 09 February 2007 12:05 > To: java-user@lucene.apache.org > Subject: RE: categorisation > > Ahhh it all makes sense to me now :-) > > -----Original Message----- > From: Erik Hatcher [mailto:erik@ehatchersolutions.com] > Sent: 09 February 2007 12:01 > To: java-user@lucene.apache.org > Subject: Re: categorisation > > > On Feb 9, 2007, at 5:40 AM, Kainth, Sachin wrote: >> It makes sense to me only if you tell me that all the bits in the=20 >> BitSet "all" will be 1. > > well, ok, so the "all" may be misleading. call it queryBits instead > then :) > > "all" means *all documents that match the query*, though. > > it wouldn't make sense to AND a bitset with one that is all 1's=20 > always. > > Erik > > >> >> -----Original Message----- >> From: Erik Hatcher [mailto:erik@ehatchersolutions.com] >> Sent: 08 February 2007 18:37 >> To: java-user@lucene.apache.org >> Subject: Re: categorisation >> >> >> On Feb 8, 2007, at 12:36 PM, Kainth, Sachin wrote: >> >>> Chris has given an example of how to perform categorisation of=20 >>> lucene >>> searches: >>> >>> String[] mfgs =3D ...; >>> String query =3D "+category:cameras +price:[0 to 10]"; >>> Query q =3D QueryParser.parse(query); >>> Hits results =3D searcher.search(q, mySort) >>> BitSet all =3D (new QueryFilter(q)).bits(reader) >>> int[] mfg_counts =3D new int[mfgs.length]; >>> for i in (0 to mfgs.length) { >>> BitSet these =3D (new QueryFilter(new TermQuery("mfg",mfgs=20 >>> [i]))).bits(reader); >>> these.and(all) >>> mfg_counts[i] =3D these.cardinality(); >>> } >>> >>> What I don't understand though is what this line does: >>> >>> BitSet all =3D (new QueryFilter(q)).bits(reader) >>> >>> Anyone have any ideas? >> >> "all" is a BitSet lit up for the documents that matched "query". >> "these" (the BitSet for a particular category) is .anded with "all" >> to get the counts _left over_ for each category given "query". >> >> Make sense? >> >> Erik >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org >> For additional commands, e-mail: java-user-help@lucene.apache.org >> >> >> >> This message has been scanned for viruses by MailControl - (see >> http://bluepages.wsatkins.co.uk/?4318150) >> >> >> This email and any attached files are confidential and copyright=20 >> protected. If you are not the addressee, any dissemination of this=20 >> communication is strictly prohibited. Unless otherwise expressly=20 >> agreed in writing, nothing stated in this communication shall be=20 >> legally binding. >> >> The ultimate parent company of the Atkins Group is WS Atkins plc. >> Registered in England No. 1885586. Registered Office Woodcote Grove, >> Ashley Road, Epsom, Surrey KT18 5BW. >> >> Consider the environment. Please don't print this e-mail unless you=20 >> really need to. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org >> For additional commands, e-mail: java-user-help@lucene.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org