Tag Archives: Search

SharePoint 2010 | Crawl Not Starting Due To Missing Search Temp Directories

I was working on a search server recently and started getting errors that the crawl component was failing to “CreateTempFolderForCacheFiles”

As it turns out, the environment I was working on was an extremely secure farm where permissions were locked down and often shares were not permitted and accounts were allowed the minimum permissions they needed in order to run.  In  this case, the local temporary folder where the index files are created had been deleted, and the search service did not have permissions to recreate the folder.  This was blocking the crawls from proceeding and they were just sitting there.

In order to fix the issue, the folders need to be recreated.  What is nice is that using PowerShell you can quickly recreate the folders in the correct location using the following script:

$app = Get-SPEnterpriseSearchServiceApplication "<my SSA>"
$crawlComponents = Get-SPEnterpriseSearchCrawlComponent -CrawlTopology $app.CrawlTopologies.ActiveTopology | where {$_.ServerName.ToLower().Equals($Env:COMPUTERNAME.ToLower()) }
foreach ($component in $crawlComponents)
{
    $path = $component.IndexLocation + "\" + $component.Name
    if ( Test-Path $path -pathType container)
    {
        Write-Host "Directory " $path " already exists"
    }
    Else
    {
        Write-Host "Creating Directory: " $path
        New-Item $path -ItemType directory | write-output
    }
}

SharePoint 2010–Search Core Results Append Text To Query Causes Best Bets Not To Display

Had an interesting issue where my Best Bets web part stopped displaying the keywords when I added the IsDocument:true filter to the “Append Text To Query” box.  It turns out that on the backend the value in the box was being passed to the query engine along with the query value, so for instance “Minutes” (Which matches a keyword) became “Minutes IsDocument:true” (which is not).

After a bit of digging I came up with and interesting scenario – Since the first core results was causing the issue, what if I removed the filter condition from it (so it now triggered the best bets) and added a second core results with the filter I wanted?  Displaying both on the page for comparison I noticed the first unfiltered one triggered the best bets, and the second core result showed the filtered results that I wanted.

The solution was:

1. remove the IsDocument:true from the first (default) Search Core Results "Append Text to Query" box

image

2. Add a second Search Core Results to the results page, add IsDocument:true to the second core results web part and position it in the spot right above the original core results web part.

image

3. Hide the first core results web part (hidden checkbox under the layouts area)

image

So now I have best bets triggering off of the first result set and being displayed in the best bets web part, but my second filtered core results web part is showing the filtered query set to the user.

SharePoint 2010 – Search Crawl Returns Error When Crawling Gantt Chart Views

Error message: The SharePoint item being crawled returned an error when attempting to download the item.

I was getting my crawl logs filled with error messages when crawling a particular section of one of my web applications that house a lot of Project collaboration sites. After investigating this issue what we found is that our standard template for projects used that Gantt chart extensively on some of the pages since the visual representation of tasks looks so darn good. The bad news was that the crawler was having problems interpreting these views. The solution was actually fairly easy once we knew the issue. For some reason it appears that the search server is presenting its crawl request as a very old version of Internet Explorer (IE 4!). The solution is to change the registry settings that control the gathering manager to present the User Agent to a higher version of IE on the search server.

  1. Open Regedit on your search server.
  2. Navigate to this registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Global\Gathering Manager
  3. Change the value of “UserAgent” from “MSIE 4.01″ to “MSIE 8.0″
  4. Reboot the server and run a full crawl to index the items that were erroring out.

It does seem strange that in an environment that no longer supports IE 6 that Microsoft hasn’t updated this registry setting to a more modern broader/user agent, but this also explains why on some of my non-SharePoint sites that I index I was seeing a proliferation of older browser hits!

SharePoint 2010–Search and Best Bets

SharePoint search is often one of the most underutilized features in SharePoint.  And while I couldn’t possibly hope to explain everything in SharePoint search in one post, I thought I would cover the concepts of ‘Best Bets’ and how to set them up.   Best bets essentially allow you to inject your chosen content at the top of search queries for certain keywords. Keyword terms are defined by an administrator to enhance search results. They can be used in queries from the Search box, the Search Center site, or Advanced Search. When a query includes a keyword term or one of its synonyms, the definition for that term and links to its featured locations or documents, called "Best Bets," are displayed prominently on the search results page, above the core search results in the Best Bets WebPart.

As an example, when ever someone types ‘iedaddy’ I want to return two key items at the top:

  1. a link to my twitter feed link
  2. a link to my blog iedaddy.com

By defining terms that are often used in searches as keywords, a site collection administrator can provide a standard glossary of names, processes, and concepts that are part of the "common knowledge" shared by members of an organization. When keywords have synonyms and associated Best Bet links, they also become handy tools for guiding users toward recommended resources.

Site collection administrators typically create keywords at the site collection level. However, you might want to coordinate keyword planning over multiple site collections to make planning and implementation consistent throughout the organization.  Remember, you must be a site collection administrator on the site collection you are performing the search from in order to add Best Bets!

Adding a keyword Best Bets

  1. Click Site Settings, and in Site Collection Administration click Search keywords.
  2. Click the “Add Keyword”
  3. Fill in keyword Phrase, synonyms…
  4. image
  5. Click the “Add Best Bet” and enter in your best bet information:
  6. image
  7. Click OK to close dialog, you can add multiple Best Bets to a Keyword:
  8. image
  9. Click Ok to close the screen.

You have now set up a best bet!

Now What?

Lets test the search from our parent site, when I type in ‘ieDaddy’ I don’t get my Best Bets Sad smile 

The issue here is that the Best Bets WebPart is not included in the _layouts/OSSSearchResults.aspx search results page.  In order to utilize the Best Bets, we need to link our search bar to default to the search center.  In the parent site click on site actions-> site settings-> search settings. Select ‘Enable custom scopes’ and fill in the appropriate link to your search center subsite.

Now if we type in ‘iedaddy’ from the parent’s search box it will return the proper results WITH the best bets.

image

 

Remember that Best Bets is not available to SharePoint Foundation, but you can get it SharePoint 2010 Search Server Express, SharePoint 2010 Standard, and SharePoint 2010 Enterprise.