You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2017/07/07 15:11:49 UTC
[2/2] lucene-solr:branch_7_0: SOLR-10989: Fixup to correct SOLR-11020
test failures (root discrepency caused by SOLR-10924)
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/5b5219ef
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5b5219ef
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5b5219ef
Branch: refs/heads/branch_7_0
Commit: 5b5219ef7bea4b1208f16d1d16ce336d54284810
Parents: 25229f2
Author: Chris Hostetter <ho...@apache.org>
Authored: Fri Jul 7 08:06:10 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Fri Jul 7 08:10:15 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/5b5219ef/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 {