lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tflo...@apache.org
Subject svn commit: r1636985 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/core/ solr/core/src/test-files/solr/collection1/conf/ solr/core/src/test/org/apache/solr/schema/
Date Wed, 05 Nov 2014 22:17:35 GMT
Author: tflobbe
Date: Wed Nov  5 22:17:34 2014
New Revision: 1636985

URL: http://svn.apache.org/r1636985
Log:
SOLR-6704: Added unit tests that uncovered TrieDateField bug in branch 4.10.x

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_5x/solr/core/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/src/test-files/solr/collection1/conf/schema.xml
    lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java
    lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/schema/PrimitiveFieldTypeTest.java

Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1636985&r1=1636984&r2=1636985&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Wed Nov  5 22:17:34 2014
@@ -342,6 +342,8 @@ Bug Fixes
 
 * SOLR-6696: bin/solr start script should not enable autoSoftCommit by default (janhoy)
 
+* SOLR-6704: TrieDateField type drops schema properties in branch 4.10 (Tomás Fernández
Löbbe)
+
 ==================  4.10.2 ==================
 
 Bug Fixes

Modified: lucene/dev/branches/branch_5x/solr/core/src/test-files/solr/collection1/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test-files/solr/collection1/conf/schema.xml?rev=1636985&r1=1636984&r2=1636985&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/test-files/solr/collection1/conf/schema.xml
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/test-files/solr/collection1/conf/schema.xml
Wed Nov  5 22:17:34 2014
@@ -83,6 +83,7 @@
       -->
     <fieldtype name="date" class="solr.TrieDateField" precisionStep="0"/>
     <fieldtype name="tdate" class="solr.TrieDateField" precisionStep="6"/>
+    <fieldtype name="tdatedv" class="solr.TrieDateField" precisionStep="6" docValues="true"
multiValued="true"/>
 
     <fieldtype name="dateRange" class="solr.DateRangeField" />
 
@@ -573,6 +574,7 @@
    <dynamicField name="*_tds" type="tdouble" indexed="true" stored="true" multiValued="false"/>
    <dynamicField name="*_tdt" type="tdate"  indexed="true"  stored="true"/>
    <dynamicField name="*_tdt1" type="tdate"  indexed="true"  stored="true" multiValued="false"/>
+   <dynamicField name="*_tdtdv" type="tdatedv"  indexed="true"  stored="true"/>
 
    <dynamicField name="*_sI" type="string"  indexed="true"  stored="false"/>
    <dynamicField name="*_sS" type="string"  indexed="false" stored="true"/>

Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java?rev=1636985&r1=1636984&r2=1636985&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java
Wed Nov  5 22:17:34 2014
@@ -92,5 +92,20 @@ public class IndexSchemaTest extends Sol
     SolrCore core = h.getCore();
     IndexSchema schema = core.getLatestSchema();
     assertFalse(schema.getField("id").multiValued());
+    
+    // Test TrieDate fields. The following asserts are expecting a field type defined as:
+    String expectedDefinition = "<fieldtype name=\"tdatedv\" class=\"solr.TrieDateField\"
" +
+        "precisionStep=\"6\" docValues=\"true\" multiValued=\"true\"/>";
+    FieldType tdatedv = schema.getFieldType("foo_tdtdv");
+    assertTrue("Expecting a field type defined as " + expectedDefinition, 
+        tdatedv instanceof TrieDateField);
+    assertTrue("Expecting a field type defined as " + expectedDefinition,
+        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());
   }
+  
+  
 }

Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/schema/PrimitiveFieldTypeTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/schema/PrimitiveFieldTypeTest.java?rev=1636985&r1=1636984&r2=1636985&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/schema/PrimitiveFieldTypeTest.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/schema/PrimitiveFieldTypeTest.java
Wed Nov  5 22:17:34 2014
@@ -24,6 +24,7 @@ import org.junit.Test;
 
 import java.io.File;
 import java.util.HashMap;
+import java.util.Map;
 import java.util.TimeZone;
 
 /**
@@ -153,4 +154,22 @@ public class PrimitiveFieldTypeTest exte
     bin.init(schema, initMap);
     assertFalse(bin.hasProperty(FieldType.OMIT_NORMS));
   }
+  
+  public void testTrieDateField() {
+    schema = IndexSchemaFactory.buildIndexSchema(testConfHome + "schema15.xml", config);
+    TrieDateField tdt = new TrieDateField();
+    Map<String, String> args = new HashMap<>();
+    args.put("sortMissingLast", "true");
+    args.put("indexed", "true");
+    args.put("stored", "false");
+    args.put("docValues", "true");
+    args.put("precisionStep", "16");
+    tdt.setArgs(schema, args);
+    assertTrue(tdt.hasProperty(FieldType.OMIT_NORMS));
+    assertTrue(tdt.hasProperty(FieldType.SORT_MISSING_LAST));
+    assertTrue(tdt.hasProperty(FieldType.INDEXED));
+    assertFalse(tdt.hasProperty(FieldType.STORED));
+    assertTrue(tdt.hasProperty(FieldType.DOC_VALUES));
+    assertEquals(16, tdt.getPrecisionStep());
+  }
 }



Mime
View raw message