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 2013/04/18 21:13:36 UTC
svn commit: r1469529 - in /lucene/dev/trunk/solr/core/src:
test-files/solr/collection1/conf/schema-copyfield-test.xml
test/org/apache/solr/schema/CopyFieldTest.java
Author: hossman
Date: Thu Apr 18 19:13:36 2013
New Revision: 1469529
URL: http://svn.apache.org/r1469529
Log:
SOLR-4729: testcase for catchall copyField
Modified:
lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml
lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/CopyFieldTest.java
Modified: lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml?rev=1469529&r1=1469528&r2=1469529&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml Thu Apr 18 19:13:36 2013
@@ -470,6 +470,8 @@
<!-- test source glob that doesn't match any explicit or dynamic field -->
<copyField source="testing123_*" dest="text"/>
+ <copyField source="*" dest="catchall_t"/>
+
<!-- Similarity is the scoring routine for each document vs a query.
A custom similarity may be specified here, but the default is fine
for most applications.
Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/CopyFieldTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/CopyFieldTest.java?rev=1469529&r1=1469528&r2=1469529&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/CopyFieldTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/CopyFieldTest.java Thu Apr 18 19:13:36 2013
@@ -245,5 +245,20 @@ public class CopyFieldTest extends SolrT
,"//*[@numFound='1']"
,"//result/doc[1]/str[@name='id'][.='A5']"
);
- }
+ }
+
+ public void testCatchAllCopyField() {
+ IndexSchema schema = h.getCore().getSchema();
+
+ assertNull("'*' should not be (or match) a dynamic field",
+ schema.getDynamicPattern("*"));
+
+ assertU(adoc("id", "A5", "sku1", "10-1839ACX-93", "testing123_s", "AAM46"));
+ assertU(commit());
+ for (String q : new String[] {"A5", "10-1839ACX-93", "AAM46" }) {
+ assertQ(req("q","catchall_t:" + q)
+ ,"//*[@numFound='1']"
+ ,"//result/doc[1]/str[@name='id'][.='A5']");
+ }
+ }
}