Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mahgo 32 posts 152 karma points
    May 18, 2016 @ 09:51
    Mahgo
    0

    Examine IncludeNodeTypes only indexing some of the nodes for that document type.

    I'm using Umbraco 7.4.2. I've created an Examine index which is successfully indexing all of my content nodes. I'm now wanting to limit this index to just the one document type. But, for some reason this only indexes a small number of these. (900 of around 35k, yes that's a lot of nodes).

    In this code below, my document type is named "Foo".

    <IndexSet SetName="FoosIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/{machinename}/Foos/">
    <IndexAttributeFields>
      <add Name="id" />
      <add Name="nodeTypeAlias" />
      <add Name="updateDate" />
      <add Name="createDate" />
    </IndexAttributeFields>
    <IndexUserFields>
      <add Name="FooField"/>
    </IndexUserFields>
    <IncludeNodeTypes>
      <add Name="foo" />
    </IncludeNodeTypes>
    

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    May 18, 2016 @ 14:18
    Ismail Mayat
    0

    Mahgo,

    In your settings do you have indexer setup to exclude unpublished items? Also is there anything in the umbraco log? Do you have an gatheringnode data events firing? It could one particular node is causing an error and preventing full indexing from happening.

    Regards

    Ismail

  • Mahgo 32 posts 152 karma points
    May 19, 2016 @ 08:56
    Mahgo
    0

    Hi Ismail,

    No, this indexer includes unpublished items, which it needs to. Here is the indexer settings:

    <add name="FooIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
           supportUnpublished="true"
           supportProtected="true"
           analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"
           />
    

    No there is nothing logged. (in the App_Data/Logs log files, if that's what you mean).

    The 900 nodes also happen to be the first 900, which I've worked out in my event handler. Here is the function called by my event handler:

    private void FooGatheringNodeDataHandler_Article(object sender, IndexingNodeDataEventArgs e)
        {
            try
            {
                if (e != null)
                {
                    IContent content = this.contentService.GetById(e.NodeId);
                    if (content != null)
                    {
                        string parentName = content.Parent()?.Name;
                        if (parentName != null)
                        {
                            e.Fields.Add("parent", parentName);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error<ExamineEvents>(string.Format("Exception: {0} - StackTrace: {1}", ex.Message, ex.StackTrace), ex);
            }
        }
    
  • Mahgo 32 posts 152 karma points
    Sep 03, 2016 @ 12:11
    Mahgo
    0

    Ismail, did you get a chance to look at this?

Please Sign in or register to post replies

Write your reply to:

Draft