nestedluceneumbracoexamine

How to apply Custom Examine Search Index on Nested Umbraco Contents?


  1. I have a doctype Home which contains nested doctype Product. And i want to be able to search Products. enter image description here
    1. I have also created an Examine indexset in ExamineIndex.config as follows:
 <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. I have created Examine Indexer in ExamineSettings.config as follows:
  <add name="ProductIndexer" type="UmbracoExamine.UmbracoMemberIndexer, UmbracoExamine"
           supportUnpublished="true"
           supportProtected="true"
           analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"
           indexSet="ProductsIndexSet"/>
  1. I have created product Searcher in ExamineSettings.config as follows:
   <add name="ProductSearcher"
               type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
                supportUnpublished="false"
               supportProtected="true"
                indexSet="ProductsIndexSet"
                analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>

But when running the Rebuild Index from Developer- Examine Management- ProductIndexer, I am getting 0 Documents in Index. enter image description here

I am really not sure how to proceed with examine over nested Contents. Can anyone help me to set up Examine Search Index on Nested Contents?


Solution

  • If your home node alias is "home" then you need to add that to your Included Node Types on the Index configuration. product doesn't need to be included unless it's also a content node in it's own right.

    You may also want to take a look at the article here which outlines an approach to indexing nested content etc.:

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