lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: ToParentBlockJoinQuery vs filtered search
Date Tue, 07 Feb 2012 15:19:08 GMT
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
<mkhludnev@griddynamics.com> wrote:
>
>
> On Mon, Feb 6, 2012 at 5:54 PM, Michael McCandless
> <lucene@mikemccandless.com> wrote:
>>
>> On Sun, Feb 5, 2012 at 11:43 PM, Mikhail Khludnev
>> <mkhludnev@griddynamics.com> 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...?  Does it
>> >> 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/org/apache/lucene/search/join/ToParentBlockJoinQuery.java?view=markup
>> > has the opposite intention (btw, are you %100 sure?):
>> >  * Children query is filtered by the given filter
>> > childWeight.scorer(readerContext, true, false, *acceptDocs*);
>> >  * Parent filter  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-framework/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.  This 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.  It 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, boolean,
> boolean, Bits){.
> ...
> final DocIdSet parents = parentsFilter.getDocIdSet(readerContext, acceptDocs
> );
>
> 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 liveDocs aren't null).
> Passing non-null bits triggers wrapping bitset by bits see
> CachingWrapperFilter.getDocIdSet(AtomicReaderContext, Bits) line 136 and
> lead to BitsFilteredDocIdSet.
>
> I moved to https://issues.apache.org/jira/browse/SOLR-3076 in according 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).  This 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


Mime
View raw message