Solr数据库6.3.0版本配置问题:whose UTF8 encoding is longer than the max length 32766
問題描述,入庫時,在solr的web界面上按條件搜索不到相應的字段內容,查看solr數據庫后臺報錯如下
2018-05-09 08:51:27.736 ERROR (http-nio-8032-exec-32) [c:comos s:shard3 r:core_node12 x:core3] o.a.s.h.RequestHandlerBase org.apache.solr.common.SolrException: Exception writing document id fytxtex5788 to the index; possible analysis error: Document contains at least one immense term in field="html" (whose UTF8 encoding is longer than the max length 32766), all of which were skipped. Please correct the analyzer to not produce such terms. The prefix of the first immense term is: '[60, 109, 101, 116, 97, 32, 104, 116, 116, 112, 45, 101, 113, 117, 105, 118, 61, 34, 67, 111]...', original message: bytes can be at most 32766 in length; got 40928. Perhaps the document has an indexed string field (solr.StrField) which is too large2018-05-09 08:51:28.629 ERROR (http-nio-8032-exec-32) [c:comos s:shard3 r:core_node12 x:core3] o.a.s.h.RequestHandlerBase org.apache.solr.common.SolrException: Exception writing document id fytxtex5788 to the index; possible analysis error: Document contains at least one immense term in field="html" (whose UTF8 encoding is longer than the max length 32766), all of which were skipped. Please correct the analyzer to not produce such terms. The prefix of the first immense term is: '[60, 109, 101, 116, 97, 32, 104, 116, 116, 112, 45, 101, 113, 117, 105, 118, 61, 34, 67, 111]...', original message: bytes can be at most 32766 in length; got 40928. Perhaps the document has an indexed string field (solr.StrField) which is too large主要報錯:ERROR o.a.s.h.RequestHandlerBase org.apache.solr.common.SolrException: Exception writing document id to the index; possible analysis error: Document contains at least one immense term in field="html" (whose UTF8 encoding is longer than the max length 32766), all of which were skipped. ?Please correct the analyzer to not produce such terms. ?The prefix of the first immense term is: '[……]...', original message: bytes can be at most 32766 in length; got 40928. Perhaps the document has an indexed string field (solr.StrField) which is too large。
問題原因:
跟網上找到的一樣,看報錯是因為field名為"html"的在入庫時因為超出默認值失敗。
解決方法:
在solr6版本以后已經用managed-schema代替了原來的schema.xml。且可以在web管理界面看到。
從圖中可以看到這個html的類型是Dynamic Field,名稱是*,然后Type是string。所以我們要做的就是找到managed-schema文件,修改<dynamicField name="*" type="string" ? ?indexed="true" ?stored="false" multiValued="true" />其中的type=text_general。
重啟Zookeeper,重新執行zookCli.sh ,重新啟動solr數據庫。查看type 變成text_general后,入庫無報錯。
總結
以上是生活随笔為你收集整理的Solr数据库6.3.0版本配置问题:whose UTF8 encoding is longer than the max length 32766的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 数据结构与算法实战-C++实现
- 下一篇: tensorboard使用_colab打