lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject [17/47] lucene-solr:feature/autoscaling: SOLR-10864: Simplified how Trie vs Points based numerics are randomized by SolrTestCaseJ4
Date Sun, 25 Jun 2017 02:06:39 GMT
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/TestGroupingSearch.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/TestGroupingSearch.java b/solr/core/src/test/org/apache/solr/TestGroupingSearch.java
index 99dc63c..77b1cf7 100644
--- a/solr/core/src/test/org/apache/solr/TestGroupingSearch.java
+++ b/solr/core/src/test/org/apache/solr/TestGroupingSearch.java
@@ -60,6 +60,9 @@ public class TestGroupingSearch extends SolrTestCaseJ4 {
 
   @BeforeClass
   public static void beforeTests() throws Exception {
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
+    
     // force LogDocMergePolicy so that we get a predictable doc order
     // when doing unsorted group collection
     systemSetPropertySolrTestsMergePolicyFactory(LogDocMergePolicyFactory.class.getName());

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java b/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java
index 0a9cb2b..46762ea 100644
--- a/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java
+++ b/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java
@@ -45,6 +45,11 @@ public class TestRandomDVFaceting extends SolrTestCaseJ4 {
 
   @BeforeClass
   public static void beforeTests() throws Exception {
+    // we need DVs on point fields to compute stats & facets
+    // but test also has hard coded assumptions about these field types *NOT* having DV when *NOT* points
+    // so use docvalue if and only if we are using points...
+    System.setProperty(NUMERIC_DOCVALUES_SYSPROP, System.getProperty(NUMERIC_POINTS_SYSPROP));
+    
     initCore("solrconfig-basic.xml","schema-docValuesFaceting.xml");
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/TestRandomFaceting.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/TestRandomFaceting.java b/solr/core/src/test/org/apache/solr/TestRandomFaceting.java
index c3a3e02..ff53315 100644
--- a/solr/core/src/test/org/apache/solr/TestRandomFaceting.java
+++ b/solr/core/src/test/org/apache/solr/TestRandomFaceting.java
@@ -57,6 +57,9 @@ public class TestRandomFaceting extends SolrTestCaseJ4 {
 
   @BeforeClass
   public static void beforeTests() throws Exception {
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
+    
     System.setProperty("enable.update.log", "false"); // schema12 doesn't support _version_
     initCore("solrconfig.xml","schema12.xml");
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java
index b95d558..838ebb5 100644
--- a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java
+++ b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java
@@ -58,6 +58,9 @@ public class BasicDistributedZk2Test extends AbstractFullDistribZkTestBase {
 
   public BasicDistributedZk2Test() {
     super();
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
+    
     sliceCount = 2;
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
index ac96b62..d74f58e 100644
--- a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
@@ -114,6 +114,9 @@ public class BasicDistributedZkTest extends AbstractFullDistribZkTestBase {
   Set<Future<Object>> pending;
   
   public BasicDistributedZkTest() {
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
+    
     sliceCount = 2;
     completionService = new ExecutorCompletionService<>(executor);
     pending = new HashSet<>();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java b/solr/core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java
index df3790d..8159e49 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestAuthenticationFramework.java
@@ -86,6 +86,7 @@ public class TestAuthenticationFramework extends LuceneTestCase {
 
   @Before
   public void setUp() throws Exception {
+    SolrTestCaseJ4.randomizeNumericTypesProperties(); // SOLR-10916
     setupAuthenticationPlugin();
     super.setUp();
   }
@@ -126,6 +127,7 @@ public class TestAuthenticationFramework extends LuceneTestCase {
 
   @After
   public void tearDown() throws Exception {
+    SolrTestCaseJ4.clearNumericTypesProperties(); // SOLR-10916
     System.clearProperty("authenticationPlugin");
     super.tearDown();
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudCluster.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudCluster.java b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudCluster.java
index a8250f8..dd4d13c 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudCluster.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudCluster.java
@@ -46,6 +46,8 @@ import org.apache.solr.common.cloud.ZkStateReader;
 import org.apache.solr.core.CoreDescriptor;
 import org.apache.solr.index.TieredMergePolicyFactory;
 import org.apache.solr.util.RevertDefaultThreadHandlerRule;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
@@ -73,6 +75,15 @@ public class TestMiniSolrCloudCluster extends LuceneTestCase {
     REPLICATION_FACTOR = 2;
   }
   
+  @BeforeClass
+  public static void setupHackNumerics() { // SOLR-10916
+    SolrTestCaseJ4.randomizeNumericTypesProperties();
+  }
+  @AfterClass
+  public static void clearHackNumerics() { // SOLR-10916
+    SolrTestCaseJ4.clearNumericTypesProperties();
+  }
+
   @Rule
   public TestRule solrTestRules = RuleChain
       .outerRule(new SystemPropertiesRestoreRule());

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/cloud/TestSolrCloudWithKerberosAlt.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestSolrCloudWithKerberosAlt.java b/solr/core/src/test/org/apache/solr/cloud/TestSolrCloudWithKerberosAlt.java
index 1758ae0..16cee78 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestSolrCloudWithKerberosAlt.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestSolrCloudWithKerberosAlt.java
@@ -94,6 +94,7 @@ public class TestSolrCloudWithKerberosAlt extends LuceneTestCase {
 
   @Override
   public void setUp() throws Exception {
+    SolrTestCaseJ4.randomizeNumericTypesProperties(); // SOLR-10916
     super.setUp();
     setupMiniKdc();
   }
@@ -225,6 +226,7 @@ public class TestSolrCloudWithKerberosAlt extends LuceneTestCase {
     System.clearProperty("solr.kerberos.name.rules");
     System.clearProperty("solr.jaas.debug");
     kerberosTestServices.stop();
+    SolrTestCaseJ4.clearNumericTypesProperties(); // SOLR-10916
     super.tearDown();
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotLargeTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotLargeTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotLargeTest.java
index 0c5e128..eb6f54d 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotLargeTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotLargeTest.java
@@ -37,6 +37,11 @@ public class DistributedFacetPivotLargeTest extends BaseDistributedSearchTestCas
   
   public static final String SPECIAL = ""; 
 
+  public DistributedFacetPivotLargeTest() {
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
+  }
+  
   @Test
   @ShardsFixed(num = 4)
   public void test() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotLongTailTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotLongTailTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotLongTailTest.java
index 52f1825..f18f551 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotLongTailTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotLongTailTest.java
@@ -40,6 +40,11 @@ import org.junit.Test;
 public class DistributedFacetPivotLongTailTest extends BaseDistributedSearchTestCase {
   
   private int docNumber = 0;
+
+  public DistributedFacetPivotLongTailTest() {
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
+  }
   
   public int getDocNum() {
     docNumber++;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotSmallAdvancedTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotSmallAdvancedTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotSmallAdvancedTest.java
index 1ed60e4..d579b7a 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotSmallAdvancedTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotSmallAdvancedTest.java
@@ -37,6 +37,11 @@ import java.util.List;
  */
 public class DistributedFacetPivotSmallAdvancedTest extends BaseDistributedSearchTestCase {
 
+  public DistributedFacetPivotSmallAdvancedTest() {
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
+  }
+  
   @Test
   @ShardsFixed(num = 2)
   public void test() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotSmallTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotSmallTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotSmallTest.java
index d293e69..71e34e3 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotSmallTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotSmallTest.java
@@ -37,6 +37,11 @@ import org.junit.Test;
 
 public class DistributedFacetPivotSmallTest extends BaseDistributedSearchTestCase {
 
+  public DistributedFacetPivotSmallTest() {
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
+  }
+  
   @Test
   @ShardsFixed(num = 4)
   public void test() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotWhiteBoxTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotWhiteBoxTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotWhiteBoxTest.java
index a824c9d..89cd687 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotWhiteBoxTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotWhiteBoxTest.java
@@ -27,6 +27,11 @@ import java.util.List;
 
 public class DistributedFacetPivotWhiteBoxTest extends BaseDistributedSearchTestCase {
 
+  public DistributedFacetPivotWhiteBoxTest() {
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
+  }
+  
   @Test
   @ShardsFixed(num = 4)
   public void test() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/handler/component/DistributedTermsComponentTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedTermsComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedTermsComponentTest.java
index b3f1f30..6f719d2 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedTermsComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedTermsComponentTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.solr.handler.component;
 
+import org.apache.solr.SolrTestCaseJ4.SuppressPointFields;
 import org.apache.solr.BaseDistributedSearchTestCase;
 import org.junit.Test;
 
@@ -25,10 +26,12 @@ import org.junit.Test;
  *
  * @since solr 1.5
  */
+@SuppressPointFields(bugUrl="https://issues.apache.org/jira/browse/SOLR-10847")
 public class DistributedTermsComponentTest extends BaseDistributedSearchTestCase {
 
   @Test
   public void test() throws Exception {
+    
     del("*:*");
     index(id, 18, "b_t", "snake spider shark snail slug seal", "foo_i", "1");
     index(id, 19, "b_t", "snake spider shark snail slug", "foo_i", "2");

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/handler/component/FacetPivotSmallTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/FacetPivotSmallTest.java b/solr/core/src/test/org/apache/solr/handler/component/FacetPivotSmallTest.java
index ce708a6..4b5e8a7 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/FacetPivotSmallTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/FacetPivotSmallTest.java
@@ -30,6 +30,8 @@ public class FacetPivotSmallTest extends SolrTestCaseJ4 {
 
   @BeforeClass
   public static void beforeClass() throws Exception {
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
     initCore("solrconfig.xml", "schema11.xml");
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java
index 568676c..3bb4974 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java
@@ -68,6 +68,8 @@ public class StatsComponentTest extends AbstractSolrTestCase {
 
   @BeforeClass
   public static void beforeClass() throws Exception {
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
     initCore("solrconfig.xml", "schema11.xml");
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java b/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java
index dca45dc..8a5f4b1 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java
@@ -61,7 +61,9 @@ public class TestDistributedStatsComponentCardinality extends BaseDistributedSea
   final long MIN_LONG;
 
   public TestDistributedStatsComponentCardinality() {
-    super();
+    // we need DVs on point fields to compute stats
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
+    
     // we want some randomness in the shard number, but we don't want multiple iterations
     fixShardCount(TEST_NIGHTLY ? 7 : random().nextInt(3) + 1);
 
@@ -142,13 +144,17 @@ public class TestDistributedStatsComponentCardinality extends BaseDistributedSea
 
       Map<String,FieldStatsInfo> stats = rsp.getFieldStatsInfo();
 
-      for (String f : STAT_FIELDS) {
-        // regardless of log2m and regwidth, the estimated cardinality of the 
-        // hashed vs prehashed values should be exactly the same for each field
-
-        assertEquals(f + ": hashed vs prehashed, real="+ numMatches + ", p=" + p,
-                     stats.get(f).getCardinality().longValue(),
-                     stats.get(f+"_prehashed_l").getCardinality().longValue());
+      if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) {
+        log.warn("SOLR-10918: can't relying on exact match with pre-hashed values when using points");
+      } else {
+        for (String f : STAT_FIELDS) {
+          // regardless of log2m and regwidth, the estimated cardinality of the 
+          // hashed vs prehashed values should be exactly the same for each field
+          
+          assertEquals(f + ": hashed vs prehashed, real="+ numMatches + ", p=" + p,
+                       stats.get(f).getCardinality().longValue(),
+                       stats.get(f+"_prehashed_l").getCardinality().longValue());
+        }
       }
 
       for (String f : STAT_FIELDS) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/request/SimpleFacetsTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/request/SimpleFacetsTest.java b/solr/core/src/test/org/apache/solr/request/SimpleFacetsTest.java
index 8f4a24d..0ee345e 100644
--- a/solr/core/src/test/org/apache/solr/request/SimpleFacetsTest.java
+++ b/solr/core/src/test/org/apache/solr/request/SimpleFacetsTest.java
@@ -50,6 +50,8 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
 
   @BeforeClass
   public static void beforeClass() throws Exception {
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
     initCore("solrconfig.xml","schema.xml");
     createIndex();
   }
@@ -368,6 +370,10 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
 
   @Test
   public void testSimpleGroupedFacets() throws Exception {
+    assumeFalse("SOLR-10844: group.facet doesn't play nice with points *OR* DocValues",
+                Boolean.getBoolean(NUMERIC_DOCVALUES_SYSPROP) || Boolean.getBoolean(NUMERIC_POINTS_SYSPROP));
+                
+    
     // for the purposes of our test data, it shouldn't matter 
     // if we use facet.limit -100, -1, or 100 ...
     // our set of values is small enough either way
@@ -497,7 +503,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
     Map rsp = (Map) ObjectBuilder.fromJSON(response);
     Long numFound  = (Long)(((Map)rsp.get("response")).get("numFound"));
 
-    ModifiableSolrParams params = params("q","*:*", "rows","0", "facet","true", "facet.field","{!key=myalias}"+field);
+    ModifiableSolrParams params = params("q","*:*", "facet.mincount","1","rows","0", "facet","true", "facet.field","{!key=myalias}"+field);
     
     String[] methods = {null, "fc","enum","fcs", "uif"};
     if (sf.multiValued() || sf.getType().multiValuedFieldCache()) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/request/TestFaceting.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/request/TestFaceting.java b/solr/core/src/test/org/apache/solr/request/TestFaceting.java
index 8933c19..9559b4c 100644
--- a/solr/core/src/test/org/apache/solr/request/TestFaceting.java
+++ b/solr/core/src/test/org/apache/solr/request/TestFaceting.java
@@ -41,6 +41,8 @@ import org.junit.Test;
 public class TestFaceting extends SolrTestCaseJ4 {
   @BeforeClass
   public static void beforeClass() throws Exception {
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
     initCore("solrconfig.xml","schema11.xml");
   }
 
@@ -269,6 +271,9 @@ public class TestFaceting extends SolrTestCaseJ4 {
 
   @Test
   public void testTrieFields() {
+    assumeFalse("Test is only relevant when randomizing Trie fields",
+                Boolean.getBoolean(NUMERIC_POINTS_SYSPROP));
+           
     // make sure that terms are correctly filtered even for trie fields that index several
     // terms for a single value
     List<String> fields = new ArrayList<>();
@@ -286,9 +291,10 @@ public class TestFaceting extends SolrTestCaseJ4 {
         for (String facetSort : new String[] {FacetParams.FACET_SORT_COUNT, FacetParams.FACET_SORT_INDEX}) {
           for (String value : new String[] {"42", "43"}) { // match or not
             final String field = "f_" + suffix;
+            final int num_constraints = ("42".equals(value)) ? 1 : 0;
             assertQ("field=" + field + ",method=" + facetMethod + ",sort=" + facetSort,
-                req("q", field + ":" + value, FacetParams.FACET, "true", FacetParams.FACET_FIELD, field, FacetParams.FACET_MINCOUNT, "0", FacetParams.FACET_SORT, facetSort, FacetParams.FACET_METHOD, facetMethod),
-                "*[count(//lst[@name='" + field + "']/int)=1]"); // exactly 1 facet count
+                req("q", field + ":" + value, FacetParams.FACET, "true", FacetParams.FACET_FIELD, field, FacetParams.FACET_MINCOUNT, "1", FacetParams.FACET_SORT, facetSort, FacetParams.FACET_METHOD, facetMethod),
+                "*[count(//lst[@name='" + field + "']/int)="+num_constraints+"]");
           }
         }
       }
@@ -329,6 +335,9 @@ public class TestFaceting extends SolrTestCaseJ4 {
 
   @Test
   public void testFacetSortWithMinCount0() {
+    assumeFalse("facet.mincount=0 doesn't work with point fields (SOLR-10033) or single valued DV",
+                Boolean.getBoolean(NUMERIC_POINTS_SYSPROP) || Boolean.getBoolean(NUMERIC_DOCVALUES_SYSPROP));
+    
     assertU(adoc("id", "1", "f_td", "-420.126"));
     assertU(adoc("id", "2", "f_td", "-285.672"));
     assertU(adoc("id", "3", "f_td", "-1.218"));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/request/TestIntervalFaceting.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/request/TestIntervalFaceting.java b/solr/core/src/test/org/apache/solr/request/TestIntervalFaceting.java
index f0c5f43..fc8ddff 100644
--- a/solr/core/src/test/org/apache/solr/request/TestIntervalFaceting.java
+++ b/solr/core/src/test/org/apache/solr/request/TestIntervalFaceting.java
@@ -46,6 +46,8 @@ public class TestIntervalFaceting extends SolrTestCaseJ4 {
 
   @BeforeClass
   public static void beforeTests() throws Exception {
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
     initCore("solrconfig-basic.xml", "schema-docValuesFaceting.xml");
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/request/TestWriterPerf.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/request/TestWriterPerf.java b/solr/core/src/test/org/apache/solr/request/TestWriterPerf.java
index 9a5329d..1e4663f 100644
--- a/solr/core/src/test/org/apache/solr/request/TestWriterPerf.java
+++ b/solr/core/src/test/org/apache/solr/request/TestWriterPerf.java
@@ -43,6 +43,8 @@ public class TestWriterPerf extends AbstractSolrTestCase {
 
   @BeforeClass
   public static void beforeClass() throws Exception {
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
     initCore("solrconfig-functionquery.xml", "schema11.xml");
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/response/TestExportWriter.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/response/TestExportWriter.java b/solr/core/src/test/org/apache/solr/response/TestExportWriter.java
index c556787..82f73f9 100644
--- a/solr/core/src/test/org/apache/solr/response/TestExportWriter.java
+++ b/solr/core/src/test/org/apache/solr/response/TestExportWriter.java
@@ -24,14 +24,11 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Set;
 
-import org.apache.lucene.index.LeafReader;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.util.SuppressForbidden;
 import org.apache.solr.common.util.Utils;
 import org.apache.solr.schema.SchemaField;
-import org.apache.solr.search.SolrIndexSearcher;
-import org.apache.solr.util.RefCounted;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -242,21 +239,13 @@ public class TestExportWriter extends SolrTestCaseJ4 {
   
   @Test
   public void testDuplicates() throws Exception {
-    RefCounted<SolrIndexSearcher> ref = null;
-    try {
-      ref = h.getCore().getSearcher();
-      LeafReader reader = ref.get().getSlowAtomicReader();
-      // MultiValued Trie fields use SortedSet
-      assertNotNull(reader.getSortedSetDocValues("int_is_t"));
-      assertNull(reader.getSortedNumericDocValues("int_is_t"));
-      // MultiValued Point fields use SortedNumerics
-      assertNull(reader.getSortedSetDocValues("int_is_p"));
-      assertNotNull(reader.getSortedNumericDocValues("int_is_p"));
-    } finally {
-      if (ref != null) ref.decref();
-    }
+    // see SOLR-10924
+    String expected = h.getCore().getLatestSchema().getField("int_is_t").getType().isPointField()
+      ? "1,1,1,1" : "1";
     String s =  h.query(req("q", "id:3", "qt", "/export", "fl", "int_is_t", "sort", "intdv asc"));
-    assertJsonEquals(s, "{\"responseHeader\": {\"status\": 0}, \"response\":{\"numFound\":1, \"docs\":[{\"int_is_t\":[1]}]}}");
+    assertJsonEquals(s, "{\"responseHeader\": {\"status\": 0}, \"response\":{\"numFound\":1, \"docs\":[{\"int_is_t\":["+expected+"]}]}}");
+    expected = h.getCore().getLatestSchema().getField("int_is_p").getType().isPointField()
+      ? "1,1,1,1" : "1";
     s =  h.query(req("q", "id:8", "qt", "/export", "fl", "int_is_p", "sort", "intdv asc"));
     assertJsonEquals(s, "{\"responseHeader\": {\"status\": 0}, \"response\":{\"numFound\":1, \"docs\":[{\"int_is_p\":[1,1,1,1]}]}}");
   }
@@ -279,7 +268,6 @@ public class TestExportWriter extends SolrTestCaseJ4 {
           SchemaField sf = h.getCore().getLatestSchema().getField(field + "_t");
           assertTrue(sf.hasDocValues());
           assertTrue(sf.getType().getNumberType() != null);
-          assertFalse(sf.getType().isPointField());
           
           sf = h.getCore().getLatestSchema().getField(field + "_p");
           assertTrue(sf.hasDocValues());

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java b/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java
index 7790859..4719f04 100644
--- a/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.solr.schema;
 
+
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.MapSolrParams;
@@ -25,6 +26,7 @@ import org.apache.solr.request.SolrQueryRequest;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -95,20 +97,22 @@ public class IndexSchemaTest extends SolrTestCaseJ4 {
     SolrCore core = h.getCore();
     IndexSchema schema = core.getLatestSchema();
     assertFalse(schema.getField("id").multiValued());
-    
+
+    final String dateClass = RANDOMIZED_NUMERIC_FIELDTYPES.get(Date.class);
+    final boolean usingPoints = Boolean.getBoolean(NUMERIC_POINTS_SYSPROP);
     // Test TrieDate fields. The following asserts are expecting a field type defined as:
-    String expectedDefinition = "<fieldtype name=\"tdatedv\" class=\"solr.TrieDateField\" " +
+    String expectedDefinition = "<fieldtype name=\"tdatedv\" class=\""+dateClass+"\" " +
         "precisionStep=\"6\" docValues=\"true\" multiValued=\"true\"/>";
     FieldType tdatedv = schema.getFieldType("foo_tdtdvs");
     assertTrue("Expecting a field type defined as " + expectedDefinition, 
-        tdatedv instanceof TrieDateField);
+               (usingPoints ? DatePointField.class : TrieDateField.class).isInstance(tdatedv));
     assertTrue("Expecting a field type defined as " + expectedDefinition,
-        tdatedv.hasProperty(FieldProperties.DOC_VALUES));
+               tdatedv.hasProperty(FieldProperties.DOC_VALUES));
     assertTrue("Expecting a field type defined as " + expectedDefinition,
-        tdatedv.isMultiValued());
-    assertEquals("Expecting a field type defined as " + expectedDefinition,
-        6, ((TrieDateField)tdatedv).getPrecisionStep());
+               tdatedv.isMultiValued());
+    if ( ! usingPoints ) {
+      assertEquals("Expecting a field type defined as " + expectedDefinition,
+                   6, ((TrieDateField)tdatedv).getPrecisionStep());
+    }
   }
-  
-  
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/schema/PolyFieldTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/PolyFieldTest.java b/solr/core/src/test/org/apache/solr/schema/PolyFieldTest.java
index 900e439..317b542 100644
--- a/solr/core/src/test/org/apache/solr/schema/PolyFieldTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/PolyFieldTest.java
@@ -48,10 +48,6 @@ public class PolyFieldTest extends SolrTestCaseJ4 {
     assertTrue(home.isPolyField());
     
     String subFieldType = "double";
-    if (usingPointFields()) {
-      subFieldType = "pdouble";
-    }
-
     SchemaField[] dynFields = schema.getDynamicFieldPrototypes();
     boolean seen = false;
     for (SchemaField dynField : dynFields) {
@@ -187,9 +183,5 @@ public class PolyFieldTest extends SolrTestCaseJ4 {
     assertEquals(2, bq.clauses().size());
     clearIndex();
   }
-  
-  private boolean usingPointFields() {
-    return h.getCore().getLatestSchema().getField("foo_d1_dv").getType().isPointField();
-  }
 
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java
index 087c7e1..b99198d 100644
--- a/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java
@@ -37,6 +37,8 @@ import org.junit.Test;
 public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
   @BeforeClass
   public static void beforeClass() throws Exception {
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
     initCore("solrconfig-collapseqparser.xml", "schema11.xml");
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/search/TestGraphTermsQParserPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestGraphTermsQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestGraphTermsQParserPlugin.java
index 1cb927d..f62a8bf 100644
--- a/solr/core/src/test/org/apache/solr/search/TestGraphTermsQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestGraphTermsQParserPlugin.java
@@ -19,6 +19,7 @@ package org.apache.solr.search;
 
 import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestCaseJ4.SuppressPointFields;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -26,6 +27,7 @@ import org.junit.Test;
 
 //We want codecs that support DocValues, and ones supporting blank/empty values.
 @SuppressCodecs({"Appending","Lucene3x","Lucene40","Lucene41","Lucene42"})
+@SuppressPointFields(bugUrl="https://issues.apache.org/jira/browse/SOLR-10845")
 public class TestGraphTermsQParserPlugin extends SolrTestCaseJ4 {
 
   @BeforeClass

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/search/TestMaxScoreQueryParser.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestMaxScoreQueryParser.java b/solr/core/src/test/org/apache/solr/search/TestMaxScoreQueryParser.java
index 53caf77..6c2694d 100644
--- a/solr/core/src/test/org/apache/solr/search/TestMaxScoreQueryParser.java
+++ b/solr/core/src/test/org/apache/solr/search/TestMaxScoreQueryParser.java
@@ -48,8 +48,14 @@ public class TestMaxScoreQueryParser extends AbstractSolrTestCase {
     assertEquals(new BoostQuery(new TermQuery(new Term("text", "foo")), 3f), q);
 
     q = parse("price:[0 TO 10]");
-    assertTrue(q instanceof LegacyNumericRangeQuery 
-        || (q instanceof IndexOrDocValuesQuery && ((IndexOrDocValuesQuery)q).getIndexQuery() instanceof PointRangeQuery));
+    Class expected = LegacyNumericRangeQuery.class;
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) {
+      expected = PointRangeQuery.class;
+      if (Boolean.getBoolean(NUMERIC_DOCVALUES_SYSPROP)) {
+        expected = IndexOrDocValuesQuery.class;
+      }
+    }
+    assertTrue(expected + " vs actual: " + q.getClass(), expected.isInstance(q));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java b/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
index 6db4800..3877c8c 100644
--- a/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
+++ b/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
@@ -41,6 +41,7 @@ import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.parser.QueryParser;
 import org.apache.solr.query.FilterQuery;
 import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.schema.SchemaField;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.noggit.ObjectBuilder;
@@ -149,14 +150,17 @@ public class TestSolrQueryParser extends SolrTestCaseJ4 {
     );
 
     // length of date math caused issues...
-    if (h.getCore().getLatestSchema().getField("foo_dt").getType().isPointField()) {
-      assertJQ(req("q", "foo_dt:\"2013-03-08T00:46:15Z/DAY+000MILLISECONDS+00SECONDS+00MINUTES+00HOURS+0000000000YEARS+6MONTHS+3DAYS\"", "debug", "query")
-          , "/debug/parsedquery=='IndexOrDocValuesQuery(foo_dt:[1378857600000 TO 1378857600000])'"
-      );
-    } else {
+    {
+      SchemaField foo_dt = h.getCore().getLatestSchema().getField("foo_dt");
+      String expected = "foo_dt:2013-09-11T00:00:00Z";
+      if (foo_dt.getType().isPointField()) {
+        expected = "(foo_dt:[1378857600000 TO 1378857600000])";
+        if (foo_dt.hasDocValues() && foo_dt.indexed()) {
+          expected = "IndexOrDocValuesQuery"+expected ;
+        }
+      }
       assertJQ(req("q", "foo_dt:\"2013-03-08T00:46:15Z/DAY+000MILLISECONDS+00SECONDS+00MINUTES+00HOURS+0000000000YEARS+6MONTHS+3DAYS\"", "debug", "query")
-          , "/debug/parsedquery=='foo_dt:2013-09-11T00:00:00Z'"
-      );
+               , "/debug/parsedquery=='"+expected+"'");
     }
   }
 
@@ -279,7 +283,11 @@ public class TestSolrQueryParser extends SolrTestCaseJ4 {
       qParser.setIsFilter(true); // this may change in the future
       qParser.setParams(params);
       q = qParser.getQuery();
-      assertEquals(20, ((TermInSetQuery)q).getTermData().size());
+      if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) {
+        assertEquals(20, ((PointInSetQuery)q).getPackedPoints().size());
+      } else {
+        assertEquals(20, ((TermInSetQuery)q).getTermData().size());
+      }
 
       // for point fields large filter query should use PointInSetQuery
       qParser = QParser.getParser("foo_pi:(1 2 3 4 5 6 7 8 9 10 20 19 18 17 16 15 14 13 12 11)", req);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/search/TestTrieFacet.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestTrieFacet.java b/solr/core/src/test/org/apache/solr/search/TestTrieFacet.java
index 158965b..67301c0 100644
--- a/solr/core/src/test/org/apache/solr/search/TestTrieFacet.java
+++ b/solr/core/src/test/org/apache/solr/search/TestTrieFacet.java
@@ -52,6 +52,8 @@ public class TestTrieFacet extends SolrTestCaseJ4 {
   
   @BeforeClass
   public static void beforeClass() throws Exception {
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
 
     initCore("solrconfig-tlog.xml","schema.xml");
 
@@ -69,18 +71,20 @@ public class TestTrieFacet extends SolrTestCaseJ4 {
       SchemaField sf = h.getCore().getLatestSchema().getField(f);
       assertFalse("who changed the schema? test isn't valid: " + f, sf.multiValued());
     }
-    
-    for (String f : P0) {
-      SchemaField sf = h.getCore().getLatestSchema().getField(f);
-      assertEquals("who changed the schema? test isn't valid: " + f,
-                   0, assertCastFieldType(sf).getPrecisionStep());
-    }
-    for (String f : P8) {
-      SchemaField sf = h.getCore().getLatestSchema().getField(f);
-      assertEquals("who changed the schema? test isn't valid: " + f,
-                   8, assertCastFieldType(sf).getPrecisionStep());
-    }
 
+    if (! Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) {
+      for (String f : P0) {
+        SchemaField sf = h.getCore().getLatestSchema().getField(f);
+        assertEquals("who changed the schema? test isn't valid: " + f,
+                     0, assertCastFieldType(sf).getPrecisionStep());
+      }
+      for (String f : P8) {
+        SchemaField sf = h.getCore().getLatestSchema().getField(f);
+        assertEquals("who changed the schema? test isn't valid: " + f,
+                     8, assertCastFieldType(sf).getPrecisionStep());
+      }
+    }
+    
     // we don't need a lot of docs -- at least one failure only had ~1000  
     NUM_DOCS = TestUtil.nextInt(random(), 200, 1500);
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
index 57b3b9e..fbffd5c 100644
--- a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
+++ b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
@@ -60,6 +60,9 @@ public class TestJsonFacets extends SolrTestCaseHS {
     // instead of the following, see the constructor
     //FacetField.FacetMethod.DEFAULT_METHOD = rand(FacetField.FacetMethod.values());
 
+    // we need DVs on point fields to compute stats & facets
+    if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
+    
     initCore("solrconfig-tlog.xml","schema_latest.xml");
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java b/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
index f19e4b0..4cee94b 100644
--- a/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
+++ b/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
@@ -293,6 +293,9 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
 
   @Test
   public void testExternalFileFieldNumericKey() throws Exception {
+    assumeFalse("SOLR-10846: ExternalFileField/FileFloatSource throws NPE if keyField is Points based",
+                Boolean.getBoolean(NUMERIC_POINTS_SYSPROP));
+    
     final String extField = "eff_trie";
     final String keyField = "eff_ti";
     assertU(adoc("id", "991", keyField, "91"));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java b/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java
index ff5d8a7..f0dac60 100644
--- a/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java
+++ b/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java
@@ -36,13 +36,14 @@ public class TestMinMaxOnMultiValuedField extends SolrTestCaseJ4 {
   /** Initializes core and does some sanity checking of schema */
   @BeforeClass
   public static void beforeClass() throws Exception {
+
     initCore("solrconfig-functionquery.xml","schema11.xml");
     checkFields(new String[] {"i", "l", "f", "d"}, new String [] {"_p", "_ni_p"});
     checkFields(new String[] {"ti", "tl", "tf", "td"}, new String [] {"", "_dv", "_ni_dv"});
   }
   
   private static void checkFields(String[] types, String[] suffixes) {
- // sanity check the expected properties of our fields (ie: who broke the schema?)
+    // sanity check the expected properties of our fields (ie: who broke the schema?)
     IndexSchema schema = h.getCore().getLatestSchema();
     for (String type : types) {
       for (String suffix : suffixes) {
@@ -50,7 +51,8 @@ public class TestMinMaxOnMultiValuedField extends SolrTestCaseJ4 {
         SchemaField sf = schema.getField(f);
         assertTrue(f + " is not multivalued", sf.multiValued());
         assertEquals(f + " doesn't have expected docValues status",
-                     f.contains("dv") || sf.getType().isPointField(), sf.hasDocValues());
+                     f.contains("dv") || f.endsWith("_p")
+                     || Boolean.getBoolean(NUMERIC_DOCVALUES_SYSPROP), sf.hasDocValues());
         assertEquals(f + " doesn't have expected index status",
                      ! f.contains("ni"), sf.indexed());
       }
@@ -222,17 +224,19 @@ public class TestMinMaxOnMultiValuedField extends SolrTestCaseJ4 {
         SolrException.ErrorCode.BAD_REQUEST);
     
     // useful error until/unless LUCENE-6709
+    assertFalse(h.getCore().getLatestSchema().getField("val_is_ndv_p").hasDocValues());
+    assertTrue(h.getCore().getLatestSchema().getField("val_is_ndv_p").multiValued());
     assertQEx("no error asking for max on a non docVals field",
-              "val_tds",
-              req("q","*:*", "fl", "field(val_tds,'max')"),
+              "val_is_ndv_p",
+              req("q","*:*", "fl", "field(val_is_ndv_p,'max')"),
               SolrException.ErrorCode.BAD_REQUEST);
     assertQEx("no error asking for max on a non docVals field",
               "max",
-              req("q","*:*", "fl", "field(val_tds,'max')"),
+              req("q","*:*", "fl", "field(val_is_ndv_p,'max')"),
               SolrException.ErrorCode.BAD_REQUEST);
     assertQEx("no error asking for max on a non docVals field",
               "docValues",
-              req("q","*:*", "fl", "field(val_tds,'max')"),
+              req("q","*:*", "fl", "field(val_is_ndv_p,'max')"),
               SolrException.ErrorCode.BAD_REQUEST);
     
     // useful error if min/max is unsupported for fieldtype
@@ -245,15 +249,6 @@ public class TestMinMaxOnMultiValuedField extends SolrTestCaseJ4 {
               req("q","*:*", "fl", "field(cat_docValues,'max')"),
               SolrException.ErrorCode.BAD_REQUEST);
     
-    // MultiValued point field with dv=false
-    assertFalse(h.getCore().getLatestSchema().getField("val_is_ndv_p").hasDocValues());
-    assertTrue(h.getCore().getLatestSchema().getField("val_is_ndv_p").getType().isPointField());
-    assertTrue(h.getCore().getLatestSchema().getField("val_is_ndv_p").multiValued());
-    assertQEx("no error asking for non-dv point fields",
-              "docValues",
-              req("q","*:*", "fl", "field(val_is_ndv_p,'max')"),
-              SolrException.ErrorCode.BAD_REQUEST);
-
   }
 
   public void testRandom() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java b/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java
index 5d98d8b..857dc65 100644
--- a/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java
+++ b/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java
@@ -131,8 +131,8 @@ public class DocumentBuilderTest extends SolrTestCaseJ4 {
     doc.addField( "home", "2.2,3.3" );
     Document out = DocumentBuilder.toDocument( doc, core.getLatestSchema() );
     assertNotNull( out.get( "home" ) );//contains the stored value and term vector, if there is one
-    assertNotNull( out.getField( "home_0" + FieldType.POLY_FIELD_SEPARATOR + System.getProperty("solr.tests.doubleClass", "pdouble") ) );
-    assertNotNull( out.getField( "home_1" + FieldType.POLY_FIELD_SEPARATOR + System.getProperty("solr.tests.doubleClass", "pdouble") ) );
+    assertNotNull( out.getField( "home_0" + FieldType.POLY_FIELD_SEPARATOR + "double") );
+    assertNotNull( out.getField( "home_1" + FieldType.POLY_FIELD_SEPARATOR + "double") );
   }
   
   /**

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38f29b26/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
----------------------------------------------------------------------
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
index e9eefb0..1497457 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
@@ -43,7 +43,9 @@ import java.nio.file.Paths;
 import java.time.Instant;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.Comparator;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -173,13 +175,6 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
 
   public static final String SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICYFACTORY = "solr.tests.mergePolicyFactory";
 
-  /**
-   * The system property {@code "solr.tests.preferPointFields"} can be used to make tests use PointFields when possible. 
-   * PointFields will only be used if the schema used by the tests uses "${solr.tests.TYPEClass}" when defining fields. 
-   * If this environment variable is not set, those tests will use PointFields 50% of the times and TrieFields the rest.
-   */
-  public static final boolean PREFER_POINT_FIELDS = Boolean.getBoolean("solr.tests.preferPointFields");
-
   private static String coreName = DEFAULT_TEST_CORENAME;
 
   public static int DEFAULT_CONNECTION_TIMEOUT = 60000;  // default socket connection timeout in ms
@@ -314,6 +309,8 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
       System.clearProperty("solr.cloud.wait-for-updates-with-stale-state-pause");
       HttpClientUtil.resetHttpClientBuilder();
 
+      clearNumericTypesProperties();
+      
       // clean up static
       sslConfig = null;
       testSolrHome = null;
@@ -510,22 +507,7 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
       mergeSchedulerClass = "org.apache.lucene.index.ConcurrentMergeScheduler";
     }
     System.setProperty("solr.tests.mergeScheduler", mergeSchedulerClass);
-    if (RandomizedContext.current().getTargetClass().isAnnotationPresent(SuppressPointFields.class)
-        || (!PREFER_POINT_FIELDS && random().nextBoolean())) {
-      log.info("Using TrieFields");
-      System.setProperty("solr.tests.intClass", "int");
-      System.setProperty("solr.tests.longClass", "long");
-      System.setProperty("solr.tests.doubleClass", "double");
-      System.setProperty("solr.tests.floatClass", "float");
-      System.setProperty("solr.tests.dateClass", "date");
-    } else {
-      log.info("Using PointFields");
-      System.setProperty("solr.tests.intClass", "pint");
-      System.setProperty("solr.tests.longClass", "plong");
-      System.setProperty("solr.tests.doubleClass", "pdouble");
-      System.setProperty("solr.tests.floatClass", "pfloat");
-      System.setProperty("solr.tests.dateClass", "pdate");
-    }
+    randomizeNumericTypesProperties();
   }
 
   public static Throwable getWrappedException(Throwable e) {
@@ -2485,4 +2467,127 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
   protected <T> T pickRandom(T... options) {
     return options[random().nextInt(options.length)];
   }
+  
+  /**
+   * The name of a sysprop that can be set by users when running tests to force the types of numerics 
+   * used for test classes that do not have the {@link SuppressPointFields} annotation:
+   * <ul>
+   *  <li>If unset, then a random variable will be used to decide the type of numerics.</li>
+   *  <li>If set to <code>true</code> then Points based numerics will be used.</li>
+   *  <li>If set to <code>false</code> (or any other string) then Trie based numerics will be used.</li>
+   * </ul>
+   * @see #NUMERIC_POINTS_SYSPROP
+   */
+  public static final String USE_NUMERIC_POINTS_SYSPROP = "solr.tests.use.numeric.points";
+  
+  /**
+   * The name of a sysprop that will either <code>true</code> or <code>false</code> indicating if 
+   * numeric points fields are currently in use, depending on the user specified value of 
+   * {@link #USE_NUMERIC_POINTS_SYSPROP} and/or the {@link SuppressPointFields} annotation and/or 
+   * randomization. Tests can use <code>Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)</code>.
+   *
+   * @see #randomizeNumericTypesProperties
+   */
+  public static final String NUMERIC_POINTS_SYSPROP = "solr.tests.numeric.points";
+  
+  /**
+   * The name of a sysprop that will be either <code>true</code> or <code>false</code> indicating if 
+   * docValues should be used on a numeric field.  This property string should be used in the 
+   * <code>docValues</code> attribute of (most) numeric fieldTypes in schemas, and by default will be 
+   * randomized by this class in a <code>@BeforeClass</code>.  Subclasses that need to force specific 
+   * behavior can use <code>System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true")</code> 
+   * to override the default randomization.
+   *
+   * @see #randomizeNumericTypesProperties
+   */
+  public static final String NUMERIC_DOCVALUES_SYSPROP = "solr.tests.numeric.dv";
+  
+  /**
+   * Sets various sys props related to user specified or randomized choices regarding the types 
+   * of numerics that should be used in tests.
+   * <p>
+   * TODO: This method can be private once SOLR-10916 is resolved
+   * </p>
+   * @see #NUMERIC_DOCVALUES_SYSPROP
+   * @see #NUMERIC_POINTS_SYSPROP
+   * @see #clearNumericTypesProperties
+   * @lucene.experimental
+   * @lucene.internal
+   */
+  public static void randomizeNumericTypesProperties() {
+
+    final boolean useDV = random().nextBoolean();
+    System.setProperty(NUMERIC_DOCVALUES_SYSPROP, ""+useDV);
+    
+    // consume a consistent amount of random data even if sysprop/annotation is set
+    final boolean randUsePoints = random().nextBoolean();
+
+    final String usePointsStr = System.getProperty(USE_NUMERIC_POINTS_SYSPROP);
+    final boolean usePoints = (null == usePointsStr) ? randUsePoints : Boolean.parseBoolean(usePointsStr);
+    
+    if (RandomizedContext.current().getTargetClass().isAnnotationPresent(SolrTestCaseJ4.SuppressPointFields.class)
+        || (! usePoints)) {
+      log.info("Using TrieFields (NUMERIC_POINTS_SYSPROP=false) w/NUMERIC_DOCVALUES_SYSPROP="+useDV);
+      
+      org.apache.solr.schema.PointField.TEST_HACK_IGNORE_USELESS_TRIEFIELD_ARGS = false;
+      private_RANDOMIZED_NUMERIC_FIELDTYPES.put(Integer.class, "solr.TrieIntField");
+      private_RANDOMIZED_NUMERIC_FIELDTYPES.put(Float.class, "solr.TrieFloatField");
+      private_RANDOMIZED_NUMERIC_FIELDTYPES.put(Long.class, "solr.TrieLongField");
+      private_RANDOMIZED_NUMERIC_FIELDTYPES.put(Double.class, "solr.TrieDoubleField");
+      private_RANDOMIZED_NUMERIC_FIELDTYPES.put(Date.class, "solr.TrieDateField");
+      
+      System.setProperty(NUMERIC_POINTS_SYSPROP, "false");
+    } else {
+      log.info("Using PointFields (NUMERIC_POINTS_SYSPROP=true) w/NUMERIC_DOCVALUES_SYSPROP="+useDV);
+
+      org.apache.solr.schema.PointField.TEST_HACK_IGNORE_USELESS_TRIEFIELD_ARGS = true;
+      private_RANDOMIZED_NUMERIC_FIELDTYPES.put(Integer.class, "solr.IntPointField");
+      private_RANDOMIZED_NUMERIC_FIELDTYPES.put(Float.class, "solr.FloatPointField");
+      private_RANDOMIZED_NUMERIC_FIELDTYPES.put(Long.class, "solr.LongPointField");
+      private_RANDOMIZED_NUMERIC_FIELDTYPES.put(Double.class, "solr.DoublePointField");
+      private_RANDOMIZED_NUMERIC_FIELDTYPES.put(Date.class, "solr.DatePointField");
+      
+      System.setProperty(NUMERIC_POINTS_SYSPROP, "true");
+    }
+    for (Map.Entry<Class,String> entry : RANDOMIZED_NUMERIC_FIELDTYPES.entrySet()) {
+      System.setProperty("solr.tests." + entry.getKey().getSimpleName() + "FieldType",
+                         entry.getValue());
+
+    }
+  }
+  
+  /**
+   * Cleans up the randomized sysproperties and variables set by {@link #randomizeNumericTypesProperties}
+   * <p>
+   * TODO: This method can be private once SOLR-10916 is resolved
+   * </p>
+   * @see #randomizeNumericTypesProperties
+   * @lucene.experimental
+   * @lucene.internal
+   */
+  public static void clearNumericTypesProperties() {
+    org.apache.solr.schema.PointField.TEST_HACK_IGNORE_USELESS_TRIEFIELD_ARGS = false;
+    System.clearProperty("solr.tests.numeric.points");
+    System.clearProperty("solr.tests.numeric.points.dv");
+    for (Class c : RANDOMIZED_NUMERIC_FIELDTYPES.keySet()) {
+      System.clearProperty("solr.tests." + c.getSimpleName() + "FieldType");
+    }
+    private_RANDOMIZED_NUMERIC_FIELDTYPES.clear();
+  }
+
+  private static final Map<Class,String> private_RANDOMIZED_NUMERIC_FIELDTYPES = new HashMap<>();
+  
+  /**
+   * A Map of "primative" java "numeric" types and the string name of the <code>class</code> used in the 
+   * corrisponding schema fieldType declaration.
+   * <p>
+   * Example: <code>java.util.Date =&gt; "solr.DatePointField"</code>
+   * </p>
+   *
+   * @see #randomizeNumericTypesProperties
+   */
+  protected static final Map<Class,String> RANDOMIZED_NUMERIC_FIELDTYPES
+    = Collections.unmodifiableMap(private_RANDOMIZED_NUMERIC_FIELDTYPES);
+  
+  
 }


Mime
View raw message