You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Uwe Schindler (JIRA)" <ji...@apache.org> on 2011/09/23 14:48:26 UTC

[jira] [Created] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter (inconsistentToBQ+broken)

Remove special handling of pure negative Filters in BooleanFilter (inconsistentToBQ+broken)
-------------------------------------------------------------------------------------------

                 Key: LUCENE-3451
                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
             Project: Lucene - Java
          Issue Type: Bug
            Reporter: Uwe Schindler
            Assignee: Uwe Schindler
             Fix For: 4.0


We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).

The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Issue Comment Edited] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery

Posted by "Mike Sokolov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114385#comment-13114385 ] 

Mike Sokolov edited comment on LUCENE-3451 at 9/25/11 11:19 PM:
----------------------------------------------------------------

Just wondering if there is a reason not to "fix" the user's query by adding a {noformat}*:*{noformat} (maybe implicitly), rather than throwing an Exception?  This is invariably the fix users are instructed to apply in this case, and it does seem to be the logical implication of a pure not-query.

Hmm - I just found the discussion over in LUCENE-3460, which addresses this point.

      was (Author: sokolov):
    Just wondering if there is a reason not to "fix" the user's query by adding a {noformat}*:*{noformat} (maybe implicitly), rather than throwing an Exception?  This is invariably the fix users are instructed to apply in this case, and it does seem to be the logical implication of a pure not-query.  
  
> Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.
> Also we should think about disallowing pure-negative Queries at all and throw UOE.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13113595#comment-13113595 ] 

Michael McCandless commented on LUCENE-3451:
--------------------------------------------

Patch looks great!

I think we should also backport to 3.x?  And advertise the breakage.  If users hit this exception it means their current searches aren't working so it's a service for us to inform them of this.

> Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch, LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.
> Also we should think about disallowing pure-negative Queries at all and throw UOE.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery

Posted by "Mike Sokolov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114385#comment-13114385 ] 

Mike Sokolov commented on LUCENE-3451:
--------------------------------------

Just wondering if there is a reason not to "fix" the user's query by adding a *:* (maybe implicitly), rather than throwing an Exception?  This is invariably the fix users are instructed to apply in this case, and it does seem to be the logical implication of a pure not-query.  

> Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.
> Also we should think about disallowing pure-negative Queries at all and throw UOE.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Schindler updated LUCENE-3451:
----------------------------------

    Attachment: LUCENE-3451.patch

Attached a patch with some changes in the BooleanQuery prohibited-only detection and all failing tests fixed:
- TestBoolean2 had a explicit prohibited-only query -> changed to assert the UOE
- TestBoolean2 had a random BQ generator. Fixed this generator to not create prohibited-only queries
- in TestComplexExplanations* the prohibited-only fake clauses were removed
- MemoryIndexTest used a list of lots of query-strings, some of them looking like that : "a -b". If the test had randomly choosen a MockTokenizer with english stopwords -> peng. Removed that Analyzer

The last example is one problem of the explicit UOE: Now a user can suddenly get UOE if he uses a query where e.g. all positive clauses are stopwords - ok, users were always confused about that. Any comments about that?

> Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.
> Also we should think about disallowing pure-negative Queries at all and throw UOE.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Issue Comment Edited] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery

Posted by "Mike Sokolov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114385#comment-13114385 ] 

Mike Sokolov edited comment on LUCENE-3451 at 9/25/11 10:57 PM:
----------------------------------------------------------------

Just wondering if there is a reason not to "fix" the user's query by adding a {noformat}*:*{noformat} (maybe implicitly), rather than throwing an Exception?  This is invariably the fix users are instructed to apply in this case, and it does seem to be the logical implication of a pure not-query.  

      was (Author: sokolov):
    Just wondering if there is a reason not to "fix" the user's query by adding a *:* (maybe implicitly), rather than throwing an Exception?  This is invariably the fix users are instructed to apply in this case, and it does seem to be the logical implication of a pure not-query.  
  
> Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.
> Also we should think about disallowing pure-negative Queries at all and throw UOE.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery

Posted by "Uwe Schindler (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13149052#comment-13149052 ] 

Uwe Schindler commented on LUCENE-3451:
---------------------------------------

This is qhy I opened the sub-issue to change queryparser.

At least we should make BoolenFilter in contrib/queries to behave like BQ and not assume all bits set initially when only negative clauses occur. We might only want to add a MatchAllDocumentsFilter to allow the behaviour from before.
                
> Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.
> Also we should think about disallowing pure-negative Queries at all and throw UOE.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Schindler updated LUCENE-3451:
----------------------------------

    Attachment: LUCENE-3451.patch

Updated patch after committing BF cleanup (LUCENE-3458).

> Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.
> Also we should think about disallowing pure-negative Queries at all and throw UOE.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery

Posted by "Yonik Seeley (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yonik Seeley updated LUCENE-3451:
---------------------------------

    Issue Type: Improvement  (was: Bug)
    
> Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.
> Also we should think about disallowing pure-negative Queries at all and throw UOE.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13113808#comment-13113808 ] 

Uwe Schindler commented on LUCENE-3451:
---------------------------------------

There is a debugging relict in last patch: BooleanQuery.this.toString() in BooleanWeights UOE, please remove that.

> Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.
> Also we should think about disallowing pure-negative Queries at all and throw UOE.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery

Posted by "Yonik Seeley (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13148973#comment-13148973 ] 

Yonik Seeley commented on LUCENE-3451:
--------------------------------------

The current handling of boolean queries with only prohibited clauses is not a bug, but working as designed, so this issue is about changing that behavior.  Currently working applications will now start unexpectedly throwing exceptions... now that's trappy.

bq. I think we should also backport to 3.x? And advertise the breakage. If users hit this exception it means their current searches aren't working

We shouldn't make assumptions like that - those applications may be working exactly as designed.
The issue with stopwords is complex - there is no *right* way IMO (returning all documents vs no documents), and some users will continue to be surprised by the results regardless of which you do.

Changing BQ to prohibit negative queries means that it will immediately mean that our QueryParser (and maybe other code) has a very serious bug.  This issue can't be committed without addressing other parts of Lucene and Solr that can generate negative queries first.

I'm currently leaning toward the current behavior of BQ.

                
> Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.
> Also we should think about disallowing pure-negative Queries at all and throw UOE.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114389#comment-13114389 ] 

Uwe Schindler commented on LUCENE-3451:
---------------------------------------

Mike,
See Sub-Task LUCENE-3460 for an explanation.

> Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.
> Also we should think about disallowing pure-negative Queries at all and throw UOE.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter (inconsistentToBQ+broken)

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Schindler updated LUCENE-3451:
----------------------------------

    Attachment: LUCENE-3451.patch

Simple patch for trunk:
- Disables the default full-1 bitset if no required/optional clauses
- Moves the Prohibited clauses at the end. The order is now: SHOULD, MUST, MUST_NOT; I am not sure if this is correct and conforms to BooleanScorer2 (I don't understand BooleanScorer2). Does somebody know in which order clauses are applied in BooleanScorer2?

> Remove special handling of pure negative Filters in BooleanFilter (inconsistentToBQ+broken)
> -------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter (inconsistentToBQ+broken)

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13113514#comment-13113514 ] 

Michael McCandless commented on LUCENE-3451:
--------------------------------------------

Can we throw an exc if a BQ or BF has only MUST_NOT clauses, since we cannot handle it?

I think silently doing the wrong thing is awful (eg led to Karl struggling to understand what was wrong).

> Remove special handling of pure negative Filters in BooleanFilter (inconsistentToBQ+broken)
> -------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Schindler updated LUCENE-3451:
----------------------------------

    Attachment: LUCENE-3451.patch

Patch that also disallows only negative clauses in BooleanQuery and BooleanFilter.

- For BF this check is done in getDocIdSet that throws UOE
- For BQ this check is done in ctor of BooleanWeight where the clauses are enumerated and counted, so the check is just an additional low-cost check.

Currently 2 core tests with DisjunctionMaxQuery fail (have to look into it, maybe they simply test the broken behaviour). Solr tests pass without problems (as Solr already has a special handling in QueryUtils).

> Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch, LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.
> Also we should think about disallowing pure-negative Queries at all and throw UOE.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter (inconsistentToBQ+broken)

Posted by "Chris Male (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13113528#comment-13113528 ] 

Chris Male commented on LUCENE-3451:
------------------------------------

bq. Can we throw an exc if a BQ or BF has only MUST_NOT clauses, since we cannot handle it?

+1.  Hit this problem myself many times when first using Solr and Lucene.

> Remove special handling of pure negative Filters in BooleanFilter (inconsistentToBQ+broken)
> -------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery

Posted by "Uwe Schindler (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Schindler updated LUCENE-3451:
----------------------------------

    Attachment: LUCENE-3451.patch

Updated patch for trunk.
                
> Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.
> Also we should think about disallowing pure-negative Queries at all and throw UOE.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery

Posted by "Uwe Schindler (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13148858#comment-13148858 ] 

Uwe Schindler commented on LUCENE-3451:
---------------------------------------

How should we proceed with this? I would like to commit this, but I am afraid of the consequences for users without a solution in QueryParser.
                
> Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.
> Also we should think about disallowing pure-negative Queries at all and throw UOE.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Schindler updated LUCENE-3451:
----------------------------------

      Description: 
We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).

The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.

Also we should think about disallowing pure-negative Queries at all and throw UOE.

  was:
We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).

The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.

    Lucene Fields: [New, Patch Available]  (was: [New])
          Summary: Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery  (was: Remove special handling of pure negative Filters in BooleanFilter (inconsistentToBQ+broken))

> Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.
> Also we should think about disallowing pure-negative Queries at all and throw UOE.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3451) Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13113960#comment-13113960 ] 

Michael McCandless commented on LUCENE-3451:
--------------------------------------------

Patch looks great Uwe!

Nice catch on the analyzers removing stop words and then making an all MUST_NOT BQ.  But, I think we should throw an exception in this case, since it's a horrible trap now?  User will get 0 results but that's flat out silently wrong?

> Remove special handling of pure negative Filters in BooleanFilter, disallow pure negative queries in BooleanQuery
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3451
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3451
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>
>         Attachments: LUCENE-3451.patch, LUCENE-3451.patch, LUCENE-3451.patch
>
>
> We should at least in Lucene 4.0 remove the hack in BooleanFilter that allows pure negative Filter clauses. This is not supported by BooleanQuery and confuses users (I think that's the problem in LUCENE-3450).
> The hack is buggy, as it does not respect deleted documents and returns them in its DocIdSet.
> Also we should think about disallowing pure-negative Queries at all and throw UOE.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org