How to start an incremental crawl of a search scop

2019-06-06 03:39发布

Can this be done? I haven't found anything out there that shows a way to do this.

1条回答
神经病院院长
2楼-- · 2019-06-06 04:17

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 
查看更多
登录 后发表回答