Apache Solr open-source search software
SOLR-4128: test proving this works now (apperas to have been fixed in SOLR-4036)
Chris M. Hostetter03c9371830f4
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema12.xml b/solr/core/src/test-files/solr/collection1/conf/schema12.xmlindex b58c9a54082..9fe49907460 100755--- a/solr/core/src/test-files/solr/collection1/conf/schema12.xml+++ b/solr/core/src/test-files/solr/collection1/conf/schema12.xml@@ -596,6 +596,11 @@<dynamicField name="bar_copydest_*" type="ignored" multiValued="true"/><dynamicField name="*_es" type="text" indexed="true" stored="true"/>+ <!-- for testing if score psuedofield is erroneously treated as multivalued+ when a matching dynamic field exists+ -->+ <dynamicField name="*core" type="ignored" multiValued="true" />+</fields><defaultSearchField>text</defaultSearchField>diff --git a/solr/core/src/test/org/apache/solr/search/TestPseudoReturnFields.java b/solr/core/src/test/org/apache/solr/search/TestPseudoReturnFields.javaindex e457ce2e7e8..074be8011ce 100644--- a/solr/core/src/test/org/apache/solr/search/TestPseudoReturnFields.java+++ b/solr/core/src/test/org/apache/solr/search/TestPseudoReturnFields.java@@ -18,6 +18,7 @@package org.apache.solr.search;import org.apache.solr.SolrTestCaseJ4;+import org.apache.solr.schema.SchemaField;import org.apache.commons.lang.StringUtils;@@ -66,6 +67,20 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {// a multi valued field (the field value is copied first, then// if the type lookup is done again later, we get the wrong thing). SOLR-4036+ // score as psuedo field - precondition checks+ for (String name : new String[] {"score", "val_ss"}) {+ SchemaField sf = h.getCore().getSchema().getFieldOrNull(name);+ assertNotNull("Test depends on a (dynamic) field mtching '"+name++ "', schema was changed out from under us!",sf);+ assertTrue("Test depends on a multivalued dynamic field matching '"+name++ "', schema was changed out from under us!", sf.multiValued());+ }++ // score as psuedo field+ assertJQ(req("q","*:*", "fq", "id:42", "fl","id,score")+ ,"/response/docs==[{'id':'42','score':1.0}]");++ // single value int using alias that matches multivalued dynamic fieldassertJQ(req("q","id:42", "fl","val_ss:val_i, val2_ss:10"),"/response/docs==[{'val2_ss':10,'val_ss':1}]");