Copied to clipboard

Flag this post as spam?

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


  • Tom 713 posts 952 karma points
    Jan 25, 2010 @ 07:36
    Tom
    0

    Running up Umbraco Examine From Source - 41944

    Hi Guys I'm trying to run up Examine based on the examples in the source. I'm finding on publish of a doc in the umbraco backend im getting the following exception:

    Object reference not set to an instance of an object.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    Line 687:                        {
    Line 688: var xNode = xDoc.CreateNode(XmlNodeType.Element, "node", "");
    Line 689: c.XmlPopulate(xDoc, ref xNode, true);
    Line 690: xmlContent.Root.Add(xNode.ToXElement());
    Line 691: }

    I've debugged and come up with the fact that the xml doc for the index doesn't exist. I thought that's what enableDefaultEventHandler did?

    does anyone have any suggestions?

    Thanks,

    Tom

    <UmbracoExamine>
            <ExamineIndexProviders enableDefaultEventHandler="true" enableAsync="false">
                <providers>
                    <add name="CompleteSiteIndex" type="UmbracoExamine.Providers.LuceneExamineIndexer, UmbracoExamine.Providers"
                 indexSet="Default"
                 debug="true"
                 enabled="true"
                 supportUnpublished="true"/>
                    <add name="FaqIndex" type="UmbracoExamine.Providers.LuceneExamineIndexer, UmbracoExamine.Providers"
                 indexSet="FaqIndex"
                 enabled="true"
                 debug="true"/>
                </providers>
            </ExamineIndexProviders>
            <ExamineSearchProviders defaultProvider="SiteSearch">
                <providers>
                    <add name="SiteSearch" type="UmbracoExamine.Providers.LuceneExamineSearcher, UmbracoExamine.Providers"
                 indexSet="Default" />
                    <add name="FaqSearch" type="UmbracoExamine.Providers.LuceneExamineSearcher, UmbracoExamine.Providers"
                 indexSet="FaqIndex" />
                </providers>
            </ExamineSearchProviders>
        </UmbracoExamine>

        <ExamineLuceneIndexSets>
            <IndexSet SetName="Default" IndexPath="~/App_Data/ExamineIndexes/SiteIndex/" MaxResults="100">
                <IndexUmbracoFields>
                    <add Name="id" />
                    <add Name="nodeName" />
                    <add Name="updateDate" />
                    <add Name="writerName" />
                    <add Name="path" />
                    <add Name="nodeTypeAlias" />
                    <add Name="parentID" />
                </IndexUmbracoFields>
                <IndexUserFields>
                    <add Name="pageTitle"/>
                    <add Name="bodyText"/>
                    <add Name="metaDescription"/>
                    <add Name="customerName"/>
                    <add Name="testimonialText"/>
                    <add Name="managerName"/>
                    <add Name="solutionName"/>
                    <add Name="solutionType"/>
                    <add Name="moduleShortName"/>
                    <add Name="moduleOverview"/>
                    <add Name="newsHeadline"/>
                    <add Name="newsSummary"/>
                    <add Name="introText"/>
                    <add Name="featureName"/>
                    <add Name="featureDescription"/>
                </IndexUserFields>
                <IncludeNodeTypes/>
                <ExcludeNodeTypes>
                    <add Name="faq"/>
                    <add Name="faqQuestion"/>
                    <add Name="faqCategory"/>
                </ExcludeNodeTypes>
            </IndexSet>
            <IndexSet SetName="FaqIndex" IndexPath="~/App_Data/ExamineIndexes/FaqIndex/" MaxResults="100">
                <IndexUmbracoFields>
                    <add Name="id" />
                    <add Name="nodeName" />
                    <add Name="updateDate" />
                    <add Name="writerName" />
                    <add Name="path" />
                    <add Name="nodeTypeAlias" />
                    <add Name="parentID" />
                </IndexUmbracoFields>
                <IndexUserFields>
                    <add Name="questionText" />
                    <add Name="bodyText" />
                </IndexUserFields>
                <IncludeNodeTypes>
                    <add Name="faqQuestion" />
                </IncludeNodeTypes>
                <ExcludeNodeTypes />
            </IndexSet>
        </ExamineLuceneIndexSets>

  • Tom 713 posts 952 karma points
    Jan 25, 2010 @ 07:41
    Tom
    0

    the 2nd time around it published the doc with no exception.. hmm

  • Tom 713 posts 952 karma points
    Jan 25, 2010 @ 08:03
    Tom
    0

    also i was wondering how to get it to auto index the entire site based on the rules defined in the web config without having to manually rebuild the index and call indexall..

    Cheers,

    Tom

  • Aaron Powell 1708 posts 3044 karma points c-trib
    Jan 25, 2010 @ 10:54
    Aaron Powell
    0

    Indexing will happen on the publish, as you've got the enableDefaultEventHandler set to true.

    But I suggest you come to the feb 16 meetup and pick Shannon's brain in person ;)

  • Tom 713 posts 952 karma points
    Jan 26, 2010 @ 23:09
    Tom
    0

    Heya Slace,

    thanks so much for the reply where is the feb 16th meetup? sounds good!

    also would you happen to know if there's a way to modify the weighting so that certain nodes have a certain weight ie page title is more important than bodyText etc?

  • Tom 713 posts 952 karma points
    Jan 26, 2010 @ 23:52
    Tom
    0

    Also just wondering is the correct way to switch providers:

    var

     

     

    results = ExamineManager.Instance.SearchProviderCollection["IndexName"].Search(SearchTextBox.Text, 100, true);

  • Aaron Powell 1708 posts 3044 karma points c-trib
    Jan 27, 2010 @ 06:02
    Aaron Powell
    0

    Feb16 is at our office - http://our.umbraco.org/events/umbraco-5th-birthday-meetup-in-sydney

    As far as I know there isn't a way you can change the weighting of certain Umbraco fields, you'd possibly have to have a custom provider handling that.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies