You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/12/31 01:49:36 UTC

[GitHub] [lucene] zhaih opened a new pull request, #12051: Fix wrong assertion in TestBooleanQuery.testQueryMatchesCount

zhaih opened a new pull request, #12051:
URL: https://github.com/apache/lucene/pull/12051

   ### Description
   
   An error discovered during a check for a commit.
   
   Error stack trace:
   ```
   org.apache.lucene.search.TestBooleanQuery > testQueryMatchesCount FAILED
       java.lang.AssertionError: expected:<5> but was:<-1>
           at __randomizedtesting.SeedInfo.seed([347B41327254C56F:C08C94809A6F6675]:0)
           at org.junit.Assert.fail(Assert.java:89)
           at org.junit.Assert.failNotEquals(Assert.java:835)
           at org.junit.Assert.assertEquals(Assert.java:647)
           at org.junit.Assert.assertEquals(Assert.java:633)
           at org.apache.lucene.search.TestBooleanQuery.testQueryMatchesCount(TestBooleanQuery.java:776)
   ```
   
   It turns out to be that after we have implemented some estimation method for BooleanQuery, this assertion is not always true anymore. Since the query is a pure disjunction query and when it contains `field:c`(The clause that retrieves all documents) the BooleanWeight will actually give a good answer.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] zhaih commented on pull request #12051: Fix wrong assertion in TestBooleanQuery.testQueryMatchesCount

Posted by GitBox <gi...@apache.org>.
zhaih commented on PR #12051:
URL: https://github.com/apache/lucene/pull/12051#issuecomment-1368503412

   Yeah it should work unless we later come up with some way to quickly pull out count in that situation as well. 
   
   But I think the assertion here may not be necessary because I see you have already added a specific test testing more comprehensive situations where boolean weights should or should not return -1. The assertion here seems was introduced at the time when the `Weight#count` API was first introduced and should be removed IMO since we have had a non-default impl right now?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] jpountz commented on pull request #12051: Fix wrong assertion in TestBooleanQuery.testQueryMatchesCount

Posted by GitBox <gi...@apache.org>.
jpountz commented on PR #12051:
URL: https://github.com/apache/lucene/pull/12051#issuecomment-1368388218

   Thanks for catching this. Would it also work if we fixed indexing to sometimes index other values, e.g. replacing `if (random().nextBoolean()) {` with `if (i != 3 && random().nextBoolean()) {` and force-merged before opening a reader?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] zhaih merged pull request #12051: Fix wrong assertion in TestBooleanQuery.testQueryMatchesCount

Posted by GitBox <gi...@apache.org>.
zhaih merged PR #12051:
URL: https://github.com/apache/lucene/pull/12051


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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