1
  1. 我有一个Home包含嵌套 doctype 的 doctype Product。我希望能够搜索产品。 在此处输入图像描述
    1. 我还在 ExamineIndex.config 中创建了一个检查索引集,如下所示:
 <IndexSet SetName="ProductsIndexSet" 
     IndexPath="~/App_Data/TEMP/ExamineIndexes/Products/" >
        <IndexAttributeFields>
          <add Name="id" />
          <add Name="nodeName"/>
          <add Name="productName"/>
          <add Name="nodeTypeAlias" />
        </IndexAttributeFields>
        <IncludeNodeTypes>    
          <add Name="homeProduct"/>
          <add Name="product"/>
        </IncludeNodeTypes>
      </IndexSet>
  1. 我在 ExamineSettings.config 中创建了检查索引器,如下所示:
  <add name="ProductIndexer" type="UmbracoExamine.UmbracoMemberIndexer, UmbracoExamine"
           supportUnpublished="true"
           supportProtected="true"
           analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"
           indexSet="ProductsIndexSet"/>
  1. 我在 ExamineSettings.config 中创建了产品搜索器,如下所示:
   <add name="ProductSearcher"
               type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
                supportUnpublished="false"
               supportProtected="true"
                indexSet="ProductsIndexSet"
                analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>

但是当从Developer-Examine Management-ProductIndexer运行重建索引时,我在索引中得到 0 个文档。 在此处输入图像描述

我真的不确定如何继续检查嵌套内容。谁能帮我在嵌套内容上设置检查搜索索引?

4

1 回答 1

1

如果您的主节点别名是“home”,那么您需要将其添加到索引配置中的包含节点类型中。 product不需要包含,除非它本身也是一个内容节点。

您可能还想看看这里的文章,它概述了索引嵌套内容等的方法:

https://youritteam.com.au/blog/indexing-content-in-complex-umbraco-data-types

于 2019-03-10T21:19:19.863 回答