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 01208921A for ; Tue, 7 Feb 2012 15:19:57 +0000 (UTC) Received: (qmail 53174 invoked by uid 500); 7 Feb 2012 15:19:56 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 52991 invoked by uid 500); 7 Feb 2012 15:19:55 -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 52984 invoked by uid 99); 7 Feb 2012 15:19:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2012 15:19:55 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [74.125.82.176] (HELO mail-we0-f176.google.com) (74.125.82.176) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2012 15:19:49 +0000 Received: by werf1 with SMTP id f1so7372323wer.35 for ; Tue, 07 Feb 2012 07:19:29 -0800 (PST) Received: by 10.216.137.147 with SMTP id y19mr5197223wei.34.1328627969154; Tue, 07 Feb 2012 07:19:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.176.211 with HTTP; Tue, 7 Feb 2012 07:19:08 -0800 (PST) In-Reply-To: References: From: Michael McCandless Date: Tue, 7 Feb 2012 10:19:08 -0500 Message-ID: Subject: Re: ToParentBlockJoinQuery vs filtered search To: dev@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmgX9UOEqOgQNMqYFmlI4s96KxlrdDJHftBMRe6HuWPSDOPwGPjEanMxDPrYGNmtFo6Gr/g X-Virus-Checked: Checked by ClamAV on apache.org Mikhail, I'll dig into this and post back on the issue... I think something is indeed not right! Thanks for raising this :) Mike McCandless http://blog.mikemccandless.com On Mon, Feb 6, 2012 at 3:59 PM, Mikhail Khludnev wrote: > > > On Mon, Feb 6, 2012 at 5:54 PM, Michael McCandless > wrote: >> >> On Sun, Feb 5, 2012 at 11:43 PM, Mikhail Khludnev >> wrote: >> >> > Thanks for resolving my hesitations. It allows me move forward. >> >> You're welcome! >> >> >> It looks like that's what your test case is testing for...? =A0Does i= t >> >> pass? >> > >> > Of course it doesn't. >> > the first reason is that BlockJoinWeight.scorer() >> > >> > http://svn.apache.org/viewvc/lucene/dev/trunk/modules/join/src/java/or= g/apache/lucene/search/join/ToParentBlockJoinQuery.java?view=3Dmarkup >> > has the opposite intention (btw, are you %100 sure?): >> > =A0* Children query is filtered by the given filter >> > childWeight.scorer(readerContext, true, false, *acceptDocs*); >> > =A0* Parent filter=A0 is not constrained >> > parentsFilter.getDocIdSet(readerContext, >> > *readerContext.reader().getLiveDocs()*); >> > That's why I asked for the rationale of filtered BJQ search. >> > >> > The also complication which I met is that >> > AssertingIndexSearcher.wrapFilter() randomly switches from filtered >> > search to FilteredQuery. >> > >> > http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test-framewor= k/java/org/apache/lucene/search/AssertingIndexSearcher.java >> > it leads to IllegalStateException"parentFilter must return >> > FixedBitSet; got "BitsFilteredDocIdSet. I suppose I can deal with it. >> >> Hang on -- there are 2 different filters here. >> >> The first one, the parentsFilter that you pass to >> ToParent/ChildBlockJoinQuery, is very specific: it must identify which >> docs are parent docs. =A0This is unchangeable: every BJQ must use this >> same filter, since what is parent and what is child was determined at >> indexing time when you indexed the blocks. =A0It must produce a >> FixedBitSet per segment (using CachingWrapperFilter does so). > > > Thank you. it's clear. But you need to pass bits into > ToParentBlockJoinQuery.BlockJoinWeight.scorer(AtomicReaderContext, boolea= n, > boolean, Bits){. > ... > final DocIdSet parents =3D parentsFilter.getDocIdSet(readerContext, accep= tDocs > ); > > It can't be liveDocs or null if you want to apply the given filter (it's = can > also be case if you have deleted documents in the generation, and > therefore=A0liveDocs aren't null). > Passing non-null bits triggers wrapping bitset by bits see > CachingWrapperFilter.getDocIdSet(AtomicReaderContext, Bits) line 136 and > lead to=A0BitsFilteredDocIdSet. > > I moved to=A0https://issues.apache.org/jira/browse/SOLR-3076=A0in accordi= ng to > Marting suggestion. Can't you reply there, please? > > >> >> >> The second filter, is the optional filter the outside app can pass to >> IndexSearcher.search -- it's this filter that I was describing in my >> last response (ie, that it will be used in the "to" document space, >> only). =A0This filter is obviously free to change per query, depending >> on what the app is doing... >> >> Mike >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org >> For additional commands, e-mail: dev-help@lucene.apache.org >> > > > > -- > Sincerely yours > Mikhail Khludnev > Lucid Certified > Apache Lucene/Solr Developer > Grid Dynamics > > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org