[GitHub] lucene-solr issue #345: LUCENE-8229: Add Weight.matches() method

2018-04-11 Thread romseygeek
Github user romseygeek commented on the issue: https://github.com/apache/lucene-solr/pull/345 bq. I agree that making the call fully lazy would be ideal This can't be done, unfortunately, as we need to know up-front if there's a match or not. Hence the slightly odd

[GitHub] lucene-solr issue #345: LUCENE-8229: Add Weight.matches() method

2018-04-11 Thread jpountz
Github user jpountz commented on the issue: https://github.com/apache/lucene-solr/pull/345 > instead of directly returning the MatchesIterator I asked for this change so that you always get a fresh new iterator, even if you already iterated positions on the same field. I

[GitHub] lucene-solr issue #345: LUCENE-8229: Add Weight.matches() method

2018-04-10 Thread dsmiley
Github user dsmiley commented on the issue: https://github.com/apache/lucene-solr/pull/345 Curious; what led to the addition of the MatchesIteratorSupplier instead of directly returning the MatchesIterator? Whatever your response may be, does the eager call to `.get` in

[GitHub] lucene-solr issue #345: LUCENE-8229: Add Weight.matches() method

2018-04-09 Thread romseygeek
Github user romseygeek commented on the issue: https://github.com/apache/lucene-solr/pull/345 I extended MatchesAsserter to keep track of the last matching document, and check that if the document one below the current collection is not a hit, then its Matches is null. ---

[GitHub] lucene-solr issue #345: LUCENE-8229: Add Weight.matches() method

2018-04-09 Thread jpountz
Github user jpountz commented on the issue: https://github.com/apache/lucene-solr/pull/345 Can we also check that it returns null on non-matching documents? --- - To unsubscribe, e-mail:

[GitHub] lucene-solr issue #345: LUCENE-8229: Add Weight.matches() method

2018-04-07 Thread romseygeek
Github user romseygeek commented on the issue: https://github.com/apache/lucene-solr/pull/345 I added an assertion to QueryUtils that calls Weight.matches() for each collected document and ensures that the response isn't null (this actually caught a bug in MTQ's handling). I've also

[GitHub] lucene-solr issue #345: LUCENE-8229: Add Weight.matches() method

2018-04-06 Thread romseygeek
Github user romseygeek commented on the issue: https://github.com/apache/lucene-solr/pull/345 > In term of testing, I think we should enforce some consistency with extractTerms The two aren't always consistent - for example, TermInSetQuery and

[GitHub] lucene-solr issue #345: LUCENE-8229: Add Weight.matches() method

2018-04-05 Thread romseygeek
Github user romseygeek commented on the issue: https://github.com/apache/lucene-solr/pull/345 > For instance I don't think it should try to report matches whenever there are no terms involved The reason I did this was to make Boolean matching accurate. Say for example you