[jira] Created: (LUCENE-2714) MUST_NOT query always retunrs no documents

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (LUCENE-2714) MUST_NOT query always retunrs no documents

JIRA jira@apache.org
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (LUCENE-2714) MUST_NOT query always retunrs no documents

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/LUCENE-2714?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven Rowe resolved LUCENE-2714.
---------------------------------

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

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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-2714) MUST_NOT query always retunrs no documents

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Christoph Schmidt commented on LUCENE-2714:
-------------------------------------------

Steven,

thank you and sorry for opening a bug. Next time I'll go the java-user list...

Christoph

> 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: [hidden email]
For additional commands, e-mail: [hidden email]