lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject [1/2] lucene-solr:branch_7x: SOLR-10989: Fixup to correct SOLR-11020 test failures (root discrepency caused by SOLR-10924)
Date Fri, 07 Jul 2017 15:11:48 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7_0 25229f21e -> 5b5219ef7
  refs/heads/branch_7x 5c35b0b71 -> e87f63b2a


SOLR-10989: Fixup to correct SOLR-11020 test failures (root discrepency caused by SOLR-10924)

(cherry picked from commit 5d1f57f8823e5b6fec5cc617606db6b714c8aaef)


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/e87f63b2
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/e87f63b2
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/e87f63b2

Branch: refs/heads/branch_7x
Commit: e87f63b2a6b144d40bbeb4aca0041ca1f1b6ede7
Parents: 5c35b0b
Author: Chris Hostetter <hossman@apache.org>
Authored: Fri Jul 7 08:06:10 2017 -0700
Committer: Chris Hostetter <hossman@apache.org>
Committed: Fri Jul 7 08:09:43 2017 -0700

----------------------------------------------------------------------
 .../solr/schema/TestUseDocValuesAsStored.java   | 24 +++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e87f63b2/solr/core/src/test/org/apache/solr/schema/TestUseDocValuesAsStored.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/TestUseDocValuesAsStored.java b/solr/core/src/test/org/apache/solr/schema/TestUseDocValuesAsStored.java
index 27b55d0..81ead13 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestUseDocValuesAsStored.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestUseDocValuesAsStored.java
@@ -159,6 +159,19 @@ public class TestUseDocValuesAsStored extends AbstractBadConfigTestBase
{
             "{'id':'xyz'}"
             + "]");
   }
+  
+  @Test
+  public void testDuplicateMultiValued() throws Exception {
+    doTest("strTF", dvStringFieldName(3,true,false), "str", "X", "X", "Y");
+    doTest("strTT", dvStringFieldName(3,true,true), "str", "X", "X", "Y");
+    doTest("strFF", dvStringFieldName(3,false,false), "str", "X", "X", "Y");
+    doTest("int", "test_is_dvo", "int", "42", "42", "-666");
+    doTest("float", "test_fs_dvo", "float", "4.2", "4.2", "-66.666");
+    doTest("long", "test_ls_dvo", "long", "420", "420", "-6666666" );
+    doTest("double", "test_ds_dvo", "double", "0.0042", "0.0042", "-6.6666E-5");
+    doTest("date", "test_dts_dvo", "date", "2016-07-04T03:02:01Z", "2016-07-04T03:02:01Z",
"1999-12-31T23:59:59Z" );
+    doTest("enum", "enums_dvo", "str", SEVERITY[0], SEVERITY[0], SEVERITY[1]);
+  }
 
   @Test
   public void testRandomSingleAndMultiValued() throws Exception {
@@ -318,9 +331,14 @@ public class TestUseDocValuesAsStored extends AbstractBadConfigTestBase
{
         xpaths[i] = "//arr[@name='" + field + "']/" + type + "[.='" + value[i] + "']";
       }
 
-      // Docvalues are sets, but stored values are ordered multisets, so cardinality depends
on the value source
-      xpaths[value.length] = "*[count(//arr[@name='" + field + "']/" + type + ") = "
-          + (isStoredField(field) ? value.length : valueSet.size()) + "]";
+      // See SOLR-10924...
+      // Trie/String based Docvalues are sets, but stored values & Point DVs are ordered
multisets,
+      // so cardinality depends on the value source
+      final int expectedCardinality =
+        (isStoredField(field) || (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)
+                                  && ! (field.startsWith("enum") || field.startsWith("test_s"))))
+        ? value.length : valueSet.size();
+      xpaths[value.length] = "*[count(//arr[@name='"+field+"']/"+type+")="+expectedCardinality+"]";
       assertU(adoc(fieldAndValues));
 
     } else {


Mime
View raw message