You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Atri Sharma (JIRA)" <ji...@apache.org> on 2019/07/08 07:04:00 UTC

[jira] [Created] (LUCENE-8905) TopDocsCollector Should Have Better Error Handling For Illegal Arguments

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-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org