Can I use a Console Application to Programmatically Create a Content Data Source and Start Crawl?

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/10045

  •  16-10-2019
  •  | 
  •  

Question

I am looking for examples where folks have programmatically defined a business data content source and setup Search Service Administration to crawl it, all within a console application. I'm aware of the BCS Meta Man, but my need is a tad different as the deliverable must be a console application. Can anyone provide links demonstrating what I'm attempting to create?

Thanks,

Sid

Was it helpful?

Solution

Here is an example of How to: Add a Content Source

You will need to use the BusinessDataContentSource class and its utility method BusinessDataContentSource::ConstructStartAddress

Once you have the content source you should be able to crawl it in the "normal" way.

How to: Programmatically Manage the Crawl of a Content Source

These examples use the server side object model and so must be run on the SharePoint server.

OTHER TIPS

I suggest you use a tool such as BDC Metaman or SharePoint Designer to create a prototype BDC model (an XML file). Then create a console application that will construct a tailored version of the model file as required (for which you will need to understand the structure of the element). You can then do the administration piece either by PowerShell script or in your console application using the SharePoint object model.

Sorry, I don't know of any examples of this actually being done, but that is how I would go about doing it.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top