Rank: Member
Groups: Registered
Joined: 4/25/2014 Posts: 2
|
I am Programmatically adding a website but wish to assign some customData to each of the indexed documents.
eg c# snippet:
Configuration configuration = new Configuration(); configuration.IndexDirectory = @"c:\indexDirectory\"; configuration.MaximumCrawlDepth = 2; DocumentIndex di = new DocumentIndex(configuration); di.ImportWebsite("http://www.foobar.com/");
???
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
Hi, referring to these http://keyoti.com/produc...20Central%20Events.html
http://keyoti.com/produc...ith%20Custom%20Data.htm
I think this is what you're looking for Code: Configuration configuration = new Configuration(); configuration.IndexDirectory = @"c:\indexDirectory\"; configuration.MaximumCrawlDepth = 2; configuration.CentralEventDispatcher.Action += new Keyoti.SearchEngine.Events.ActionEventHandler(CentralEventDispatcher_Action);
DocumentIndex di = new DocumentIndex(configuration); di.ImportWebsite("http://www.foobar.com/");
...
private void CentralEventDispatcher_Action(object sender, Keyoti.SearchEngine.Events.ActionEventArgs e)
{
if(e.ActionData.Name== ActionName.ReadText)
{
string documentUri = (sender as Document).Uri.AbsoluteUri;
(e.ActionData.Data as DocumentText).MetaCustomData = "my custom data";
}
}
-your feedback is helpful to other users, thank you!-your feedback is helpful to other users, thank you!
|
Rank: Member
Groups: Registered
Joined: 4/25/2014 Posts: 2
|
|