lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-366) Combining FilteredQueries in a BooleanQuery doesn't work
Date Fri, 05 May 2006 21:17:28 GMT
    [ http://issues.apache.org/jira/browse/LUCENE-366?page=comments#action_12378147 ] 

Hoss Man commented on LUCENE-366:
---------------------------------



FYI: Test code failed to compile because of removed deprecated methods on the trunk in prep
for 2.0 release, with those methods changed the code compiles and the test passes.

> Combining FilteredQueries in a BooleanQuery doesn't work
> --------------------------------------------------------
>
>          Key: LUCENE-366
>          URL: http://issues.apache.org/jira/browse/LUCENE-366
>      Project: Lucene - Java
>         Type: Bug

>   Components: Search
>     Versions: unspecified
>  Environment: Operating System: other
> Platform: Other
>     Reporter: Hoss Man (Legacy Bugzilla Account)
>  Attachments: TestKippingPeterBug.java
>
> from java-user@lucene ...
> : > From: Kipping, Peter
> : > Sent: Friday, March 25, 2005 10:34 AM
> : > To: java-user
> : > Subject: FilteredQuery and Boolean AND
> : >
> : > I have the following query structure:
> : >
> : > BooleanQuery q2 = new BooleanQuery();
> : > TermQuery tq = new TermQuery(new Term("all_entries", "y"));
> : > FilteredQuery fq = new FilteredQuery(tq, ft);
> : > FilteredQuery fq2 = new FilteredQuery(tq, ft2);
> : > q2.add(fq, false, false);
> : > q2.add(fq2, false, false);
> : >
> : > The two filters are searches over numeric ranges.  I'm using filters so
> : > I don't get the TooManyBooleanClauses Exception.  And my TermQuery tq
> : > is
> : > just a field that has 'y' in every document so I can filter over the
> : > entire index.  The last two lines I am creating a boolean OR, and
> : > everything works fine.  I get back 30 documents which is correct.
> : >
> : > However when I change the last two lines to create an AND:
> : >
> : > q2.add(fq, true, false);
> : > q2.add(fq2, true, false);
> : >
> : > I still get back 30 documents, which is not correct.  It should be 0.
> : > What's going on with FilteredQuery?
> Date: Fri, 1 Apr 2005 16:52:55 -0800 (PST)
> From: Chris Hostetter
> To: java-user
> Subject: Re: FilteredQuery and Boolean AND
> Peter's problem intrigued me, so I wrote my own test case using two simple
> Filters that filter out all but the first (or last) doc.  I seem to be
> getting the same results he is, which is certianly.  see attached test case.
> while this definitely seems like a bug, it also seems like a fairly
> inefficinent way of approaching hte problem in general, instead of:
>   BooleanQuery containing:
>     a) FilteredQuery wrapping:
>         Query for "all" -- filtered by -- RangeFilter #1
>     b) FilteredQuery wrapping:
>         Query for "all" -- filtered by -- RangeFilter #2
> ...it seems like it would make more sense to use...
>   FilterQuery wrapping:
>     Query for all -- filtered by -- ChainedFilter containing:
>       a) RangeFilter #1
>       b) RangeFilter #2
> -------------------------------
> I'll attach the testcase momentarily

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message