Sitecore自定义索引-WARN无法映射索引文档(字段:_uniqueid

时间:2019-05-25 12:51:23

标签: linq solr sitecore9

我已经使用FlatDataCrawler在Sitecore中创建了自定义索引。

索引已创建,我可以在Solr中看到我的文档。

问题是,每当我尝试在代码中获取这些文档时,都会看到如下异常:

    const Graph = ForceGraph3D()
    (document.getElementById('3d-graph'))
     .nodeThreeObject(() =>
        new THREE.CSS3DObject(<<DOM>>)
        )

在sitecore日志文件中,我看到此警告:

Object reference not set to an instance of an object.

这是我的索引配置:

ManagedPoolThread #4 14:29:09 INFO  Solr Query - ?q=*:*&rows=1000000&fq=_indexname:(products_index)&wt=xml
ManagedPoolThread #4 14:29:09 WARN  Could not map index document (field: _uniqueid; Value: fae308d2-233f-4f7f-a4fd-9d880e42ff13) - Object reference not set to an instance of an object.

这是我的代码:

<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:search="http://www.sitecore.net/xmlconfig/search/">
    <sitecore role:require="Standalone or ContentManagement" search:require="solr">
        <contentSearch>
            <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
                <indexes hint="list:AddIndex">
                    <index id="products_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
                        <param desc="name">$(id)</param>
                        <param desc="core">$(id)</param>
                        <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
                        <configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration">
                            <documentOptions type="Sitecore.ContentSearch.SolrProvider.SolrDocumentBuilderOptions, Sitecore.ContentSearch.SolrProvider">
                                <indexAllFields>false</indexAllFields>
                            </documentOptions>
                        </configuration>
                        <strategies hint="list:AddStrategy">
                            <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual" />
                        </strategies>
                        <locations hint="list:AddCrawler">
                            <crawler type="Feature.ProductsIndex.Crawlers.CustomOrderCrawler, Feature.ProductsIndex" />
                        </locations>
                    </index>
                </indexes>
            </configuration>
        </contentSearch>
    </sitecore>
</configuration>

1 个答案:

答案 0 :(得分:0)

在架构文件中查看,如果有

<uniqueKey>_uniqueid</uniqueKey>
<field name="_uniqueid" type="string" indexed="true" required="true" stored="true"/>

如果不遵循此链接populate solr schema ,然后重新启动solr服务,然后尝试重建索引