You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Steven Rowe (JIRA)" <ji...@apache.org> on 2010/10/19 14:38:27 UTC

[jira] Issue Comment Edited: (LUCENE-2714) MUST_NOT query always retunrs no documents

    [ https://issues.apache.org/jira/browse/LUCENE-2714?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922537#action_12922537 ] 

Steven Rowe edited comment on LUCENE-2714 at 10/19/10 8:36 AM:
---------------------------------------------------------------

Christoph,

Before opening JIRA issues, please send an email to the java-user list (see http://lucene.apache.org/java/docs/mailinglists.html#Java%20User%20List).

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 {noformat}*:*{noformat} match-all-docs query to the clause in question.


      was (Author: steve_rowe):
    Christoph,

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: https://issues.apache.org/jira/browse/LUCENE-2714
>             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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org