Sitecore – SOLR Unknown Field Issue

Following  a question concerning an unknown field on SOLR, I have decided to write a blog post on how to fix this common issue. Normally, it is the following error that is received:

<response>
  <lst name="responseHeader">
    <int name="status">400</int>
    <int name="QTime">9</int>
  </lst>
  <lst name="error">
    <str name="msg">ERROR: [doc=sitecore://master/{634bb534-7f7e-409c-b491-e147fcf6bc97}?lang=ja-jp&amp;ver=1&amp;ndx=sitecore_master_index] unknown field 'name_t_ja'</str>
    <int name="code">400</int>
  </lst>
</response>

You may have other unknown fields. In order to fix this particular issue, you need to open your Schema file.

Once opened, you need to scroll down to the tags <dynamicField …… >. Once there, you need to add your dynamic field. So, as an example, using the above error, the following dynamic field should be inserted:

<dynamicField name=”*_t_ja” type=”text_general” indexed=”true” stored=”true”/>

Note that the name attribute may be changed depending on the error. Another example,

<response>
  <lst name="responseHeader">
    <int name="status">400</int>
    <int name="QTime">111</int>
  </lst>
  <lst name="error">
    <str name="msg">ERROR: [doc=sitecore://master/{f8c69ccd-422c-40ac-843d-2e4144f16964}?lang=uk-ua&ver=1&ndx=sitecore_marketing_asset_index_master] unknown field 'width_t_uk'</str>
    <int name="code">400</int>
  </lst>
</response>

To fix this one, the following dynamic field should be inserted into the Schema file:

<dynamicField name=”*_t_uk” type=”int” indexed=”true” stored=”true”/>

The type attribute will vary base on the value type. From the 2 example I have provided, you will see that the type attribute is different. One is set to text_general and and the other is set to int.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s