lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Otis Gospodnetic (JIRA)" <>
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
    [ ] 

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:
>      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 message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message