Good call, Chris.....I followed the BitSet comparison route and found that the custom filter was working exactly as it should, but *I* wasn't passing it correct data. Rookie mistake.
Doh! I hate it when that happens. -- j On 9/13/05, Jeff Rodenburg <[EMAIL PROTECTED]> wrote: > > > On 9/13/05, Chris Hostetter <[EMAIL PROTECTED]> wrote: > > > > > > I just had another thought: is the number of results you get back from > > each of the filters the same as the number you get back if you apply no > > filter? > > > In one case yes, in another case no. I've been able to test to either some > results, or zero results. Very strange. > I'll post some test code in a while. > > If so, then: > > > > a) Perhaps you don't realize this, but a Filter can never be used to > > increase the number of results returned by a query. Filter's can only > > limit the number of items returned. No matter how many bits are set to > > true in the BitSet you return, the Searcher won't even check the bits > > for > > documents with a score of zero. > > > Haven't checked the scores of the returning documents in the aggregated > result set, but believe (on appearance) that they have greater-than-zero > scores. > > > b) Is it possible that your filter isn't doing anything all, ie: is there > > any execution path that may return a BitSet in which every bit is set? > > > It's either doing nothing or not working at all. This seems to be the > likely culprit. Strangely enough, the custom filter is used previously and > works fine. > > ...also, an easy way to sanity test your CustomFilter is to skip the Query > > object alltogether, and just call the Filter.bits(IndexReader) directly > > on each filter, and compare the BitSets you get back. if they are > > .equals() then there's your problem. > > > Will do the step-through following this manner and post the results. > > -- j > > : Date: Tue, 13 Sep 2005 17:22:49 -0700 > > : From: Jeff Rodenburg < [EMAIL PROTECTED]> > > : Reply-To: java-user@lucene.apache.org, [EMAIL PROTECTED] > > : To: Chris Hostetter < [EMAIL PROTECTED]> > > : Cc: java-user@lucene.apache.org > > : Subject: Re: Hits issue or custom filter issue? > > : > > : Might be the same issue, haven't been able to determine during a > > : step-through on the code exec. > > : You're right, no need to add a new FilteredQuery to the statement, > > just a > > : search on combinedQuery with a new myCustomFilter. > > : Unfortunately, no joy; same response. > > : > > : -- j > > : > > : On 9/13/05, Chris Hostetter <[EMAIL PROTECTED]> wrote: > > : > > > : > > > : > : Hits h1 = oMultiSearcher.Search(new FilteredQuery(combinedQuery, > > new > > : > : myCustomFilter(1))); > > : > : Hits h2 = oMultiSearcher.Search(new FilteredQuery(combinedQuery, > > new > > : > : myCustomFilter(2))); > > : > > > : > ...do you get the same results if you use... > > : > > > : > Hits h1 = oMultiSearcher.search(combinedQuery, myCustomFilter(1)); > > : > Hits h2 = oMultiSearcher.search(combinedQuery, myCustomFilter(2)); > > : > > > : > ...I'm not sure why you wouldn't use that method call instead > > anyway. > > : > > > : > This may be another sympton of a bug that worked in the trunk when i > > : > reported it... > > : > > > : > http://issues.apache.org/jira/secure/ViewIssue.jspa?key=LUCENE-366 > > : > > > : > > > : > > > : > -Hoss > > : > > > : > > > : > > > > > > > > -Hoss > > > > >