文档至少包含一个巨大的术语 - Solr

Document contains at least one immense term - Solr

我正在使用 solr 库为我的文档编制索引。它按预期工作,但有时我会遇到错误。你能帮忙解决这个问题吗?

文档在 field="FileContent_en***" 中至少包含一个巨大的术语(其 UTF8 编码长度超过最大长度 32766),所有这些都被跳过。请更正分析器以使其不产生此类项。第一个巨大术语的前缀是:'[110, 97, 109, 101, 61, 34, 97, 99, 113, 117, 105, 115, 105, 116, 105, 111, 110, 115, 116, 111 , 114, 101, 34, 62, 101, 106, 122, 107, 118, 118]...', 原始消息:字节长度最多为32766;得到 422071。也许文档有一个索引字符串字段 (solr.StrField),它太大 solr.StrField

提前致谢

将您的字段的字段类型从字符串更改为文本。

例如,您的字段定义应如下所示。

<field name="text" type="text_general" indexed="true" stored="true"/>

String (UTF-8 encoded string or Unicode). Strings are intended for small fields and are not tokenized or analyzed in any way. They have a hard limit of slightly less than 32K.