【问题标题】:Sitecore document field is null after building the index构建索引后 Sitecore 文档字段为空
【发布时间】:2016-08-10 08:15:57
【问题描述】:

我遇到了一个问题,在 sitecore 中发布网站然后构建 sitecore_web_index 项目被索引但文档字段值为 null!

我正在 Windows 10 上开发 Sitecore 8.1

使用 luke 看看发生了什么

有什么建议可以解决这个问题吗?

【问题讨论】:

    标签: indexing sitecore lucene.net sitecore8


    【解决方案1】:

    检查这些字段的索引上的存储类型。默认情况下,Lucene 索引中的许多字段设置为storageType="NO" - 这将索引字段内容但不将数据存储在索引中,因此字段在结果中将始终显示为空。

    来自Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config的示例配置:

    <fieldTypes hint="raw:AddFieldByFieldTypeName">
        <fieldType fieldTypeName="attachment" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String"   settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider" />
        <!-- omitted for brevity -->
    </fieldTypes>
    

    如果您需要查看结果中的字段内容,请在配置中为需要的字段类型设置storageType="YES"。请注意,这会增加索引的大小。

    【讨论】:

    • @Richard Seal,这有必要吗?我的意思是,如果我将 storageType 保持为“否”,我是否仍然可以在该字段上进行搜索,因为默认情况下所有字段都是“否”并且搜索通常有效?
    • 如果 storageType 是 No - 搜索仍然有效。该字段仍然在索引中标记化并且可搜索。 但是 - 您将无法从索引中检索该字段的值,您必须前往 Sitecore 项目以获取该值。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-21
    • 2021-09-02
    相关资源
    最近更新 更多