Solr index error "Document contains at least one immense term in field"

This is an error you will see in Solr 5 and 6 when trying to index the content of large files. Here is the fix specific to Solr 6.2.1, should be similar for other versions.

1) Navigate to the conf folder of the Solr Index

e.g. D:\Solr\apache-solr\server\solr\project_faceted_search\conf\

2) Open the solrconfig.xml

3) Find this line:

 <initParams path=“/update/**,/query,/select,/tvrh,/elevate,/spell,/browse”>

and update this section to:

 <initParams path=“/update/**,/query,/select,/tvrh,/elevate,/spell,/browse”>
   <lst name=“defaults”>
     <str name=“df”>_text_</str>
 <str name=“update.chain”>add-unknown-fields-to-the-schema</str>
   </lst>
 </initParams>

4) Find this line:

<updateRequestProcessorChain name=“add-unknown-fields-to-the-schema”>

and add the following processor section:

<!– fix to “Document contains at least one immense term in field” error –>
<processor class=“solr.TruncateFieldUpdateProcessorFactory”>
<str name=“typeClass”>solr.StrField</str>
<int name=“maxLength”>10000</int>
</processor>

5) In the Solr Core Admin, select the Core, reload, and the optimize.

6) Rebuild the index in Sitecore.

Reference:

http://developmentsitecore.blogspot.com.au/2015/08/resolved-solr-exceptions-document.html