lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Rowe (JIRA)" <>
Subject [jira] Resolved: (LUCENE-2714) MUST_NOT query always retunrs no documents
Date Tue, 19 Oct 2010 12:36:28 GMT


Steven Rowe resolved LUCENE-2714.

       Resolution: Invalid
    Lucene Fields:   (was: [New])


Before opening JIRA issues, please send an email to the java-user list (see ).

The issue you raise here is that each query clause (parenthetical expression or entire query)
must have a SHOULD or MUST set of results from which to remove MUST_NOT documents - in other
words, MUST_NOT queries are set-subtractive, and unless there is a set of matches from which
to subtract -- at the clause level -- you get zero hits from that clause.  

You have already found the way to deal with it, that is, adding the {{*:*}} match-all-docs
query to the clause in question.

> MUST_NOT query always retunrs no documents
> ------------------------------------------
>                 Key: LUCENE-2714
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Query/Scoring
>    Affects Versions: 2.9.3
>            Reporter: Christoph Schmidt
> The following two queries are logically equal, but return different document results:
> query1 = +body:term -id:17
> query2 = +(+body:term) +(-id:17)
> query1 returns all documents containing term in the field body not having id 17.
> query2 returns no documents
> Maybe is a kind of optimization that documents with score = 0.0 are ignored?
> query3 = +(+body:term) +(+*:* -id:17)
> has the same result as query1 again.
> Thanks for help.
> Best regards
> Christoph Schmidt

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message