gpt4 book ai didi

solr - 索引 d :content property with content > 32 KB

转载 作者:行者123 更新时间:2023-12-04 11:50:42 26 4
gpt4 key购买 nike

我有一个带有 d:content 类型附加属性的 Alfresco 模型类型.当我尝试在其中存储大于 32 KB 的内容时,此属性会导致 Solr 异常。此属性的当前定义是

<property name="acme:secondContent">
<type>d:content</type>
<mandatory>false</mandatory>
<index enabled="true">
<atomic>true</atomic>
<stored>true</stored>
<tokenised>both</tokenised>
</index>
</property>

如果我将大于 32 KB 的内容放入此属性,则 Solr 在尝试对其进行索引时会抛出此异常:
java.lang.IllegalArgumentException: Document contains at least one immense term in field="content@s____@{http://acme.com/model/custom/1.0}secondContent" (whose UTF8 encoding is longer than the max length 32766), all of which were skipped.  Please correct the analyzer to not produce such terms.

更改 index配置没有帮助, index 的所有变体都会抛出错误以及我尝试过的子元素。

another question答案是:

The maximum size for the a single term in the underlying Lucene index is 32776 bytes, which is I believe hard coded.



我如何配置 indexd:content属性以便我可以保存和索引大于 32 KB 的内容?

编辑:

contentModel.xml , cm:content配置如下:
<index enabled="true">
<atomic>true</atomic>
<stored>false</stored>
<tokenised>true</tokenised>
</index>

添加一个简单的 text/plain内容大于 32 KB 的文件可以正常工作。

index我的自定义属性的配置仍然失败。

更新:

在 Alfresco 4.2fCE 下,不会出现该问题。所以这是 Alfresco 5.0c 和 Solr 4.1.9 中的一个错误。

更新 2:

我已经 filed a bug in the Alfresco JIRA .

最佳答案

假设1

如果您的内容包含类似的非常长的术语(长度为 32k 的单个单词),您必须实现自己的 Lucene 分析器来支持该特定类型的文本。这意味着这是一个与默认 Lucene 实现相关的问题,因为它是硬编码的。

假设2

否则,如果您的内容没有按照上述方式构建,这对我来说听起来很奇怪,可能是一个错误。如果您没有使用 tokenised=true 解决,在这种情况下,潜在的解决方法可能是基于更改内容模型以支持父节点和包含相关文本的特定类型节点之间的关联,但使用默认 cm:内容属性。我的意思是使用你应该解决的关联;)

希望这可以帮助。

关于solr - 索引 d :content property with content > 32 KB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29510587/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com