[ https://issues.apache.org/jira/browse/LUCENE-8110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16305512#comment-16305512 ]
Christine Poerschke commented on LUCENE-8110: --------------------------------------------- bq. Should we add a test as well? Yes, that would be ideal. From what I vaguely recall, one way to encounter the exception is to index a document _without_ an assigned class before there are any other documents or before there are documents with an assigned class. Or alternatively asking for multiple predicted classes when there is only one class assigned so far, something like that. I only stumbled across this and don't have bandwidth at the moment to work on a test or tests, so will revert for now then. > fix potential IndexOutOfBoundsException in *Classifier.getClasses(?,int) > ------------------------------------------------------------------------ > > Key: LUCENE-8110 > URL: https://issues.apache.org/jira/browse/LUCENE-8110 > Project: Lucene - Core > Issue Type: Bug > Reporter: Christine Poerschke > Assignee: Christine Poerschke > Priority: Minor > Attachments: LUCENE-8110.patch > > > KNearestNeighborDocumentClassifier already has the [one-line > fix|https://github.com/apache/lucene-solr/blob/releases/lucene-solr/7.2.0/lucene/classification/src/java/org/apache/lucene/classification/document/KNearestNeighborDocumentClassifier.java#L102] > via SOLR-8871 and this ticket here is to add the same to the remaining > Classifier classes. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org