Apache Lucene open-source search software
SOLR-10864: Fixup: Restore the DV vs trie vs points intent of TestRandomDVFaceting
Chris Hostetterf3c851a015e5
diff --git a/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java b/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.javaindex 46762ea006a..aaeab54d5fc 100644--- a/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java+++ b/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java@@ -28,6 +28,8 @@ import org.apache.lucene.util.LuceneTestCase.Slow;import org.apache.solr.common.params.ModifiableSolrParams;import org.apache.solr.request.SolrQueryRequest;import org.apache.solr.schema.SchemaField;+import org.apache.solr.schema.TrieIntField;+import org.apache.solr.schema.IntPointField;import org.junit.BeforeClass;import org.junit.Test;import org.slf4j.Logger;@@ -39,18 +41,36 @@ import org.slf4j.LoggerFactory;* to the indexed facet results as if it were just another faceting method.*/@Slow[email protected](bugUrl="Test explicitly compares Trie to Points, randomization defeats the point")public class TestRandomDVFaceting extends SolrTestCaseJ4 {private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());@BeforeClasspublic 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));+ // This tests explicitly compares Trie DV with non-DV Trie with DV Points+ // so we don't want randomized DocValues on all Trie fields+ System.setProperty(NUMERIC_DOCVALUES_SYSPROP, "false");initCore("solrconfig-basic.xml","schema-docValuesFaceting.xml");++ assertEquals("DocValues: Schema assumptions are broken",+ false, h.getCore().getLatestSchema().getField("foo_i").hasDocValues());+ assertEquals("DocValues: Schema assumptions are broken",+ true, h.getCore().getLatestSchema().getField("foo_i_dv").hasDocValues());+ assertEquals("DocValues: Schema assumptions are broken",+ true, h.getCore().getLatestSchema().getField("foo_i_p").hasDocValues());++ assertEquals("Type: Schema assumptions are broken",+ TrieIntField.class,+ h.getCore().getLatestSchema().getField("foo_i").getType().getClass());+ assertEquals("Type: Schema assumptions are broken",+ TrieIntField.class,+ h.getCore().getLatestSchema().getField("foo_i_dv").getType().getClass());+ assertEquals("Type: Schema assumptions are broken",+ IntPointField.class,+ h.getCore().getLatestSchema().getField("foo_i_p").getType().getClass());+}int indexSize;