Atri Sharma created LUCENE-8905: ----------------------------------- Summary: TopDocsCollector Should Have Better Error Handling For Illegal Arguments Key: LUCENE-8905 URL: https://issues.apache.org/jira/browse/LUCENE-8905 Project: Lucene - Core Issue Type: Improvement Reporter: Atri Sharma
While writing some tests, I realised that TopDocsCollector does not behave well when illegal arguments are passed in (for eg, requesting more hits than the number of hits collected). Instead, we return a TopDocs instance with 0 hits. This can be problematic when queries are being formed by applications. This can hide bugs where malformed queries return no hits and that is surfaced upstream to client applications. I found a TODO at the relevant code space, so I believe it is time to fix the problem and throw an IllegalArgumentsException. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org