开发者

How to start an incremental crawl of a search scope from code in SharePoint?

Can this be done? I haven't fo开发者_运维知识库und anything out there that shows a way to do this.


A search scope can not be crawled. A search scope may include or exclude a content source which is actually crawled.

To start a crawl on a content source use the following code:

SearchServiceApplicationProxy proxy = SearchServiceApplicationProxy.GetProxy(SPServiceContext.Current);
Guid appId = ssap.GetSearchServiceApplicationInfo().SearchServiceApplicationId;
SearchServiceApplication app = SearchService.Service.SearchApplications.GetValue<SearchServiceApplication>(appId);
Content content = new Content(app)

ContentSource cs = content.ContentSources["<content source name>"];
cs.StartIncrementalCrawl();
// check on cs.CrawlStatus if finished 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜