Am 8. February 2010 um 15:41 eingetragen

Manchmal kann es von Vorteil sein, dass eine Indizierung manuell gestartet wird. Dies kann zum Beispiel bei Änderung von kritischen Daten notwendig sein, damit diese entsprechend in der Suchfunktion aktuell sind.

 

Folgendes Snippet startet die inkrementelle Indizierung:

 


string sURL = SPContext.Current.Site.Url;
SearchContext ctx;
 
using (SPSite Site = new SPSite(sURL))
{
     ctx = SearchContext.GetContext(Site);
}
 
Microsoft.Office.Server.Search.Administration.Content sspCnt = new Microsoft.Office.Server.Search.Administration.Content(ctx);
 
string sCntSrc = ConfigurationManager.AppSettings["ContentSources"];               
ContentSourceCollection sspCntCol = sspCnt.ContentSources;
ContentSource contentsource = sspCntCol [sCntSrc];
 
if (cs.CrawlStatus == CrawlStatus.Idle)
     cs.StartIncrementalCrawl();
 
 

 



3 Comments vorhanden.


Kategorien:.NET , C# , Sharepoint , Snippet
Tags:,
Aktionen:E-mail | Permalink | Kick it! | DZone it! | del.icio.us

Comments


August 29. 2010 03:44
I love reading your web site.

http://www.squidoo.com/stats/traffic/Try-SMOKELESS-CIGARETTES-freehttp://www.squidoo.com/stats/traffic/Try-SMOKELESS-CIGARETTES-free


August 29. 2010 05:45
The proprietary herbal formulation in Zero Nicotine contains ingredients that act as natural substitutes for nicotine; thereby satisfying the body’s craving for this substance, without all the negative side effects of patches containing the actual drug, the nicotine. The all-natural ingredients will make you crave fewer cigarettes each day. This gradual process allows you to quit with no withdrawal symptoms and requires less willpower and effort on your part.

http://zero-nicotine.com/tag/stop-smoking/http://zero-nicotine.com/tag/stop-smoking/


August 31. 2010 04:24
Cheers for this directory, found site through Uni and will send it on.

http://hubpages.com/hub/Lemonade-Diet-Supplements-Get-A-Free-Bottlehttp://hubpages.com/hub/Lemonade-Diet-Supplements-Get-A-Free-Bottle

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading