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
  •  | 
  •  

Pergunta

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

Foi útil?

Solução

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.

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top