Copied to clipboard

Flag this post as spam?

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


  • karthikeyan 2 posts 22 karma points
    Nov 17, 2012 @ 13:35
    karthikeyan
    0

    In Examine search

    I am  using Examine search for the site search function,

    In that i don't reterive the chilnode in the C#,

    Examine.Config section

    <add name="school"/>

    //EventHandler section

     public ExamineEvents()

     {

     var studentIndex= (LuceneIndexer)ExamineManager.Instance.IndexProviderCollection["studentIndex"];

    studentIndex.GatheringNodeData += new EventHandler<IndexingNodeDataEventArgs>(studentIndex_GatheringNodeData);

    }

     //To Get All the Node Values

    private void studentIndex_GatheringNodeData(object sender, IndexingNodeDataEventArgs e)

    {

        var node = uQuery.GetNode(e.NodeId);//geting the Node ID
         if (node != null)
          {
             IEnumerable<Node> schools = node.GetChildNodesByType("Education");//identity child node
              if (schools.Any())
               {
                  var School = new StringBuilder();
                  foreach (Node school in schools)//getting the all the properties
                   {
                        School.Append(school.Name).Append(" ");//append the school Name
                    }
                    e.Fields.Add("school", School.ToString());//Append the School Name as the node
                 }
            }

    }

     

Please Sign in or register to post replies

Write your reply to:

Draft