如何在嵌套的Umbraco内容上应用自定义检查搜索索引?

问题描述 投票:0回答:1
  1. 我有一个doctype Home,其中包含嵌套的doctype Product。我希望能够搜索产品。 enter image description here 我还在ExamineIndex.config中创建了一个Examine索引集,如下所示:
 <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中创建了Examine Indexer,如下所示:
  <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运行Rebuild Index时,我在Index中得到0个文档。 enter image description here

我真的不确定如何继续检查嵌套的内容。任何人都可以帮我设置嵌套内容的检查搜索索引吗?

nested lucene umbraco examine
1个回答
0
投票

如果您的主节点别名是“home”,则需要将其添加到Index配置中的Included Node Types。 product不需要包括在内,除非它本身也是一个内容节点。

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

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

© www.soinside.com 2019 - 2024. All rights reserved.