You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Otis Gospodnetic (JIRA)" <ji...@apache.org> on 2006/05/10 06:24:04 UTC

[jira] Closed: (LUCENE-567) BooleanQuery Does Not Work With One Query indicated as MUST_NOT

     [ http://issues.apache.org/jira/browse/LUCENE-567?page=all ]
     
Otis Gospodnetic closed LUCENE-567:
-----------------------------------

    Resolution: Won't Fix

> BooleanQuery Does Not Work With One Query indicated as MUST_NOT
> ---------------------------------------------------------------
>
>          Key: LUCENE-567
>          URL: http://issues.apache.org/jira/browse/LUCENE-567
>      Project: Lucene - Java
>         Type: Bug

>   Components: Search
>     Versions: 1.9
>  Environment: JDK 1.5, Lucene 1.9.1, Windows XP
>     Reporter: Nicholaus Shupe
>     Priority: Minor

>
> The following code won't create a boolean query which will return anything but a passed in query:
>         BooleanQuery result = new BooleanQuery();
>         result.add(myQuery, BooleanClause.Occur.MUST_NOT);
> I'll get no results if I use this query.  As a workaround, I have to add a MatchAllDocsQuery in order to get it to work.
>         BooleanQuery result = new BooleanQuery();
>         result.add(new MatchAllDocsQuery(), BooleanClause.Occur.SHOULD);
>         result.add(myQuery, BooleanClause.Occur.MUST_NOT);
> Maybe this is intended???? If so, perhaps the JavaDocs should be updated to indicate this.

-- 
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