Monday, July 9, 2018

Sitecore SOLR - unknown field MyFieldName

After adding a new computed index field to my SOLR web index, I was getting the following error on rebuild:
Job started: Index_Update_IndexName=sitecore_web_index|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> SolrNet.Exceptions.SolrConnectionException: <?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">400</int><int name="QTime">1</int></lst><lst name="error"><lst name="metadata"><str name="error-class">org.apache.solr.common.SolrException</str><str name="root-error-class">org.apache.solr.common.SolrException</str></lst><str name="msg">ERROR: [doc=sitecore://web/{57606db8-1237-463b-a934-01f3854a2909}?lang=en&amp;ver=0&amp;ndx=sitecore_web_index] unknown field 'MyFieldName'</str><int name="code">400</int></lst>
</response>
 ---> System.Net.WebException: The remote server returned an error: (400) Bad Request.
This is due to the fact that when I added the field to the index, the returnType was set as:
returnType="System.Double"
Where it should have been set as:
returnType="double"
This data return type is mapped on the SOLR field map:
Sitecore SOLR Field Map

No comments:

Post a Comment