From 0159d494f562a5a22c8e5ed7ad412fad62b5db55 Mon Sep 17 00:00:00 2001 From: Chris Hostetter Date: Thu, 29 Jun 2017 15:09:39 -0700 Subject: [PATCH] SOLR-10979: Randomize PointFields in schema-docValues*.xml and all affected tests --- solr/CHANGES.txt | 1 + .../solr/collection1/conf/schema-docValues.xml | 10 +++++----- .../solr/collection1/conf/schema-docValuesFaceting.xml | 10 +++++----- .../solr/collection1/conf/schema-docValuesJoin.xml | 10 +++++----- .../solr/collection1/conf/schema-docValuesMissing.xml | 10 +++++----- .../solr/collection1/conf/schema-docValuesMulti.xml | 10 +++++----- .../org/apache/solr/schema/DocValuesMultiTest.java | 10 +++++++--- 7 files changed, 33 insertions(+), 28 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 30d334b5011..0d2226f3b81 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -363,6 +363,7 @@ Other Changes - SOLR-10970: Randomize PointFields in all tests using schema-*sort* files (hossman) - SOLR-10971: Randomize PointFields in CdcrBootstrapTest (hossman) - SOLR-10977: Randomize the usage of Points based numerics in schema15.xml and all impacted tests (hossman) + - SOLR-10979: Randomize PointFields in schema-docValues*.xml and all affected tests (hossman) * SOLR-6807: Changed requestDispatcher's handleSelect to default to false, thus ignoring "qt". Simplified configs to not refer to handleSelect or "qt". Switch all tests that assumed true to assume false diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-docValues.xml b/solr/core/src/test-files/solr/collection1/conf/schema-docValues.xml index 0216791d48d..4a5ab17843e 100644 --- a/solr/core/src/test-files/solr/collection1/conf/schema-docValues.xml +++ b/solr/core/src/test-files/solr/collection1/conf/schema-docValues.xml @@ -38,14 +38,14 @@ These are provided more for backward compatability, allowing one to create a schema that matches an existing lucene index. --> - - - - + + + + - + diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-docValuesFaceting.xml b/solr/core/src/test-files/solr/collection1/conf/schema-docValuesFaceting.xml index f7c6bfce064..a8eed081d49 100644 --- a/solr/core/src/test-files/solr/collection1/conf/schema-docValuesFaceting.xml +++ b/solr/core/src/test-files/solr/collection1/conf/schema-docValuesFaceting.xml @@ -17,11 +17,11 @@ --> - - - - - + + + + + diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-docValuesJoin.xml b/solr/core/src/test-files/solr/collection1/conf/schema-docValuesJoin.xml index d2188fc0954..844a472f091 100644 --- a/solr/core/src/test-files/solr/collection1/conf/schema-docValuesJoin.xml +++ b/solr/core/src/test-files/solr/collection1/conf/schema-docValuesJoin.xml @@ -29,11 +29,11 @@ 1.5: omitNorms defaults to true for primitive field types (int, float, boolean, string...) 1.6: useDocValuesAsStored defaults to true. --> - - - - - + + + + + diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-docValuesMissing.xml b/solr/core/src/test-files/solr/collection1/conf/schema-docValuesMissing.xml index ac319e29ecc..d80a426d23c 100644 --- a/solr/core/src/test-files/solr/collection1/conf/schema-docValuesMissing.xml +++ b/solr/core/src/test-files/solr/collection1/conf/schema-docValuesMissing.xml @@ -19,11 +19,11 @@ - - - - - + + + + + diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-docValuesMulti.xml b/solr/core/src/test-files/solr/collection1/conf/schema-docValuesMulti.xml index 81c78364369..eb841890e16 100644 --- a/solr/core/src/test-files/solr/collection1/conf/schema-docValuesMulti.xml +++ b/solr/core/src/test-files/solr/collection1/conf/schema-docValuesMulti.xml @@ -18,14 +18,14 @@ - - - - + + + + - + diff --git a/solr/core/src/test/org/apache/solr/schema/DocValuesMultiTest.java b/solr/core/src/test/org/apache/solr/schema/DocValuesMultiTest.java index 30dea854f84..8697b264d61 100644 --- a/solr/core/src/test/org/apache/solr/schema/DocValuesMultiTest.java +++ b/solr/core/src/test/org/apache/solr/schema/DocValuesMultiTest.java @@ -30,7 +30,7 @@ import org.junit.BeforeClass; import org.junit.Test; public class DocValuesMultiTest extends SolrTestCaseJ4 { - + @BeforeClass public static void beforeTests() throws Exception { initCore("solrconfig-basic.xml", "schema-docValuesMulti.xml"); @@ -55,6 +55,10 @@ public class DocValuesMultiTest extends SolrTestCaseJ4 { @Test public void testDocValues() throws IOException { + + final DocValuesType expectedNumericDvType = Boolean.getBoolean(NUMERIC_POINTS_SYSPROP) ? + DocValuesType.SORTED_NUMERIC : DocValuesType.SORTED_SET; + assertU(adoc("id", "1", "floatdv", "4.5", "intdv", "-1", "intdv", "3", "stringdv", "value1", "stringdv", "value2", "booldv", "false", "booldv", "true")); @@ -68,8 +72,8 @@ public class DocValuesMultiTest extends SolrTestCaseJ4 { final FieldInfos infos = reader.getFieldInfos(); assertEquals(DocValuesType.SORTED_SET, infos.fieldInfo("stringdv").getDocValuesType()); assertEquals(DocValuesType.SORTED_SET, infos.fieldInfo("booldv").getDocValuesType()); - assertEquals(DocValuesType.SORTED_SET, infos.fieldInfo("floatdv").getDocValuesType()); - assertEquals(DocValuesType.SORTED_SET, infos.fieldInfo("intdv").getDocValuesType()); + assertEquals(expectedNumericDvType, infos.fieldInfo("floatdv").getDocValuesType()); + assertEquals(expectedNumericDvType, infos.fieldInfo("intdv").getDocValuesType()); SortedSetDocValues dv = reader.getSortedSetDocValues("stringdv"); assertEquals(0, dv.nextDoc());