There is a new option in SharePoint 2013 that allows you to re-index list or document library.
You can find more about this on those blogs:
- http://blogs.msdn.com/b/armenk/archive/2013/02/12/how-to-force-whole-list-or-library-to-be-re-crawled-by-search.aspx
- http://www.learningsharepoint.com/2012/12/17/the-new-reindex-list-and-reindex-document-library-option-in-sharepoint-2013
Important:It does not work in SharePoint 2010!
It is also possible to do it for whole web. Thanks to this all items in all lists will be re-crawled.
I would like to show you how to do it using API.
When using API you can use it on any type of list. It also works for non-document library items, like tasks.
Re-crawl Web
void Main() { using (SPSite site = new SPSite("http://demosvr1/web1/")) using (SPWeb web = site.OpenWeb()) { object versionObj = web.AllProperties["vti_searchversion"]; int version = ((versionObj is int) ? ((int) versionObj) : 0); web.SetProperty("vti_searchversion", (version + 1)); web.Update(); } }
Re-crawl list
void Main() { using (SPSite site = new SPSite("http://demosvr1/web1/")) using (SPWeb web = site.OpenWeb()) { SPList docList = web.Lists["Documents"]; object versionObj = docList.RootFolder.Properties["vti_searchversion"]; int version = ((versionObj is int) ? ((int) versionObj) : 0); docList.RootFolder.SetProperty("vti_searchversion", (version + 1)); docList.Update(); } }
Powershell version for the folder one
function markFolderForSearch($web,$list){
$web = get-spweb $web
$list = $web.lists[$list]
if($list){
$version = $list.RootFolder.Properties[“vti_searchversion”]
if(!$version){
$version = 0;
}
$list.RootFolder.SetProperty(“vti_searchversion”, $version+1)
$list.update()
} else {
write-host “List not found” -ForegroundColor Red
}
}
Does it work on items(documents) and not root folders?
for documents there is an option for this in UI.