You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by cp...@apache.org on 2021/01/22 14:29:57 UTC

[lucene-solr] branch branch_8_8 updated (07d5a6e -> 3046bcf)

This is an automated email from the ASF dual-hosted git repository.

cpoerschke pushed a change to branch branch_8_8
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git.


    from 07d5a6e  SOLR-15073: Fix ClassCastException in SystemInfoHandler.getSecurityInfo (#2210)
     new e2e375c  SOLR-15071: add TestEdisMaxSolrFeature.testEdisMaxSolrFeatureCustomMM() test case (#2201)
     new 3046bcf  SOLR-15071: Fix ArrayIndexOutOfBoundsException in contrib/ltr SolrFeatureScorer (#2196)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 solr/CHANGES.txt                                      |  3 +++
 .../src/java/org/apache/solr/ltr/feature/Feature.java |  8 +++-----
 .../solr/ltr/feature/TestEdisMaxSolrFeature.java      | 19 +++++++++++++++++++
 .../test/org/apache/solr/ltr/feature/TestFeature.java |  3 +++
 4 files changed, 28 insertions(+), 5 deletions(-)


[lucene-solr] 01/02: SOLR-15071: add TestEdisMaxSolrFeature.testEdisMaxSolrFeatureCustomMM() test case (#2201)

Posted by cp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cpoerschke pushed a commit to branch branch_8_8
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit e2e375c397701b6bd3d5c55f7e48bc3dc465f9ee
Author: Florin Babes <ho...@users.noreply.github.com>
AuthorDate: Thu Jan 14 12:44:26 2021 +0200

    SOLR-15071: add TestEdisMaxSolrFeature.testEdisMaxSolrFeatureCustomMM() test case (#2201)
    
    * add test case for SOLR-15071
    
    * add temporary @Ignore to be removed when the fix is committed
    
    Co-authored-by: Florin Babes <fl...@emag.ro>
    Co-authored-by: Christine Poerschke <cp...@apache.org>
---
 .../solr/ltr/feature/TestEdisMaxSolrFeature.java    | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

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 e162c8c..f9401eb 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,6 +21,7 @@ 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 {
@@ -73,4 +74,24 @@ public class TestEdisMaxSolrFeature extends TestRerankBase {
     restTestHarness.query("/query" + query.toQueryString());
     assertJQ("/query" + query.toQueryString(), "/response/numFound/==4");
   }
+
+  @Ignore("SOLR-15071")
+  @Test
+  public void testEdisMaxSolrFeatureCustomMM() throws Exception {
+    loadFeature(
+        "SomeEdisMaxMM1",
+        SolrFeature.class.getName(),
+        "{\"q\":\"{!edismax qf='title' mm=1}${term}\"}");
+    loadFeature(
+        "SomeEdisMaxMM5",
+        SolrFeature.class.getName(),
+        "{\"q\":\"{!edismax qf='title' mm=5}${term}\"}");
+
+    final SolrQuery query = new SolrQuery();
+    query.setQuery("title:w1 w2 w3 w4 w5 w6 w7 w8");
+    query.add("fl", "*,features:[fv store=test efi.term=\"w1 w2 w3 w4 w5 w6 w7 w8\"]");
+
+    restTestHarness.query("/query" + query.toQueryString());
+    assertJQ("/query" + query.toQueryString(), "/response/numFound/==4");
+  }
 }


[lucene-solr] 02/02: SOLR-15071: Fix ArrayIndexOutOfBoundsException in contrib/ltr SolrFeatureScorer (#2196)

Posted by cp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cpoerschke pushed a commit to branch branch_8_8
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 3046bcf608fb6bdd6fe8fcd5fd7213103e802c9d
Author: Christine Poerschke <cp...@apache.org>
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 cc25964..7f57a35 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -147,6 +147,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 51f95e5..41d83bc 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
@@ -29,7 +29,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;
@@ -372,10 +371,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;