lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Otis Gospodnetic (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-567) BooleanQuery Does Not Work With One Query indicated as MUST_NOT
Date Wed, 10 May 2006 04:22:04 GMT
    [ http://issues.apache.org/jira/browse/LUCENE-567?page=comments#action_12378820 ] 

Otis Gospodnetic commented on LUCENE-567:
-----------------------------------------

That is by design.  Purely negative queries are not supported, which is why you had to add
that MatchAllDocsQuery to get things to work.  Got a little patch for the Javadoc?

> 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


Mime
View raw message