From commits-return-120665-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Fri Jan 22 13:35:23 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id D57CC180638 for ; Fri, 22 Jan 2021 14:35:23 +0100 (CET) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id F131265FF5 for ; Fri, 22 Jan 2021 13:35:22 +0000 (UTC) Received: (qmail 36637 invoked by uid 500); 22 Jan 2021 13:35:22 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 36628 invoked by uid 99); 22 Jan 2021 13:35:22 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jan 2021 13:35:22 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id C768081FE6; Fri, 22 Jan 2021 13:35:21 +0000 (UTC) Date: Fri, 22 Jan 2021 13:35:20 +0000 To: "commits@lucene.apache.org" Subject: [lucene-solr] branch master updated: SOLR-15071: Fix ArrayIndexOutOfBoundsException in contrib/ltr SolrFeatureScorer (#2196) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <161132252012.23954.12412642176283496071@gitbox.apache.org> From: cpoerschke@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: lucene-solr X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: fb88b0268aa0c7f14d77ae425b4851a8bedd2327 X-Git-Newrev: 32e95ddb3f2542fbe2cb116ac58453182149f07b X-Git-Rev: 32e95ddb3f2542fbe2cb116ac58453182149f07b X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. cpoerschke pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/lucene-solr.git The following commit(s) were added to refs/heads/master by this push: new 32e95dd SOLR-15071: Fix ArrayIndexOutOfBoundsException in contrib/ltr SolrFeatureScorer (#2196) 32e95dd is described below commit 32e95ddb3f2542fbe2cb116ac58453182149f07b Author: Christine Poerschke AuthorDate: Fri Jan 22 13:34:58 2021 +0000 SOLR-15071: Fix ArrayIndexOutOfBoundsException in contrib/ltr SolrFeatureScorer (#2196) --- solr/CHANGES.txt | 3 +++ .../contrib/ltr/src/java/org/apache/solr/ltr/feature/Feature.java | 8 +++----- .../test/org/apache/solr/ltr/feature/TestEdisMaxSolrFeature.java | 2 -- .../ltr/src/test/org/apache/solr/ltr/feature/TestFeature.java | 3 +++ 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index c07d251..5e8a254 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -366,6 +366,9 @@ Bug Fixes * SOLR-15073: Fix ClassCastException in SystemInfoHandler.getSecurityInfo. (Nikolay Ivanov, Christine Poerschke) +* SOLR-15071: Fix ArrayIndexOutOfBoundsException in contrib/ltr SolrFeatureScorer. + (Florin Babes, Ovidiu Mihalcea, David Smiley, Christine Poerschke) + Other Changes --------------------- diff --git a/solr/contrib/ltr/src/java/org/apache/solr/ltr/feature/Feature.java b/solr/contrib/ltr/src/java/org/apache/solr/ltr/feature/Feature.java index bc7ff87..52a0cef 100644 --- a/solr/contrib/ltr/src/java/org/apache/solr/ltr/feature/Feature.java +++ b/solr/contrib/ltr/src/java/org/apache/solr/ltr/feature/Feature.java @@ -27,7 +27,6 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.QueryVisitor; import org.apache.lucene.search.Scorer; -import org.apache.lucene.search.TwoPhaseIterator; import org.apache.lucene.search.Weight; import org.apache.lucene.util.Accountable; import org.apache.lucene.util.RamUsageEstimator; @@ -365,10 +364,9 @@ public abstract class Feature extends Query implements Accountable { return in.iterator(); } - @Override - public TwoPhaseIterator twoPhaseIterator() { - return in.twoPhaseIterator(); - } + // Currently (Q1 2021) we intentionally don't delegate twoPhaseIterator() + // because it doesn't always work and we don't yet know why, please see + // SOLR-15071 for more details. @Override public int advanceShallow(int target) throws IOException { diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/feature/TestEdisMaxSolrFeature.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/feature/TestEdisMaxSolrFeature.java index f9401eb..bbc8815 100644 --- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/feature/TestEdisMaxSolrFeature.java +++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/feature/TestEdisMaxSolrFeature.java @@ -21,7 +21,6 @@ import org.apache.solr.ltr.TestRerankBase; import org.apache.solr.ltr.model.LinearModel; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; public class TestEdisMaxSolrFeature extends TestRerankBase { @@ -75,7 +74,6 @@ public class TestEdisMaxSolrFeature extends TestRerankBase { assertJQ("/query" + query.toQueryString(), "/response/numFound/==4"); } - @Ignore("SOLR-15071") @Test public void testEdisMaxSolrFeatureCustomMM() throws Exception { loadFeature( diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/feature/TestFeature.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/feature/TestFeature.java index 15fc40d..6c4dc08 100644 --- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/feature/TestFeature.java +++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/feature/TestFeature.java @@ -30,6 +30,9 @@ public class TestFeature extends SolrTestCase { for (final Method scorerClassMethod : Scorer.class.getDeclaredMethods()) { try { + // the FilterFeatureScorer may simply inherit Scorer's default implementation + if (scorerClassMethod.getName().equals("twoPhaseIterator")) continue; + // the FilterFeatureScorer's implementation does not influence its parent Weight if (scorerClassMethod.getName().equals("getWeight")) continue;