-
Bug
-
Resolution: Won't Fix
-
Neutral
-
None
-
5.2.2
Follow SUPPORT-10649:
Error occurs inĀ
info.magnolia.search.solrsearchprovider.logic.result.SingleSolrSearchResultTransformer
on the line
anAbstract = (String)solrDocument.getFieldValue("abstract");
The result of getFieldValue is in this case an ArrayList of 1 value. All my fields return an ArrayList.
Investigation shown that "abstract" field was configured to use "text_general" fieldType:
<field name="abstract" type="text_general"/>
While text_general fieldType was configured as "multiValued":
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="true">
Also from Javadoc of Solr function getFieldValue of a SolrDocument may return a single value or a collection of values:
Object org.apache.solr.common.SolrDocument.getFieldValue(String name) Get the value or collection of values for a given field.
However when implementing function info.magnolia.search.solrsearchprovider.logic.result.SingleSolrSearchResultTransformer.transform(SolrDocument, Collection<?>) we casted a single String object to get its result:
String anAbstract = (String) solrDocument.getFieldValue("abstract");
This is a bug when implementing the module, please fix it accordingly. Any workaround or suggestion are welcome!
- mentioned in
-
Page Loading...