You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ct...@apache.org on 2021/01/15 21:45:41 UTC

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

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

ctargett pushed a commit to branch jira/solr-13105-toMerge
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit a3058a0c6e12d9f1857d4138023f3a118f538ae1
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");
+  }
 }