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 } }
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
}
}
}
is working on a reply...