Feb 10, 2013

Empy SharePoint Search results

We had this problem using the combination of SharePoint Foundation 2010 with Search Server Express 2010 where the results would come back empty.

The logs showed some errors with a SOAP request including an exception in: Microsoft.SharePoint.SPUser.get_Sid()

I remembered that we had moved this SharePoint installation from one domain to another and had to do some database tinkering of the UserInfo table (not recommended) after SP-MoveUser didn't quite get the job done. So I did the following:
  1. A quick listing of logins and their SID via PowerShell of all users of the root SPWeb object. Sure enough, the problematic migrated users showed a null SID. 
  2. A listing with the RawSID field showed that these users had an SID, but its format was very different from other valid SID's.
  3. I edited the UserInfo table (not recommended as it got us here in the first place) and updated the t_SystemId field to a valid SID with "Update UserInfo t_SystemId = CONVERT(VarBinary(512),"0x150049595959994939")) where t_Login = "domain\baduser". It's important to insert a unique SID (copied and modified from another user) as the t_SystemId column has a Unique index on it.
  4. After that, I did a full crawl and it seemed to find results in the search administration page. BUT THE RESULTS IN SHAREPOINT WERE STILL EMPTY!
  5. A Google Search found a tip (http://go4answers.webhost4life.com/Example/foundation-server-2010-search-returning-30817.aspx) : the URL's in the search content source must be the same as the default site URL (not the intranet, public or external URL's).
  6. Changing the content source URL fixed the problem.

No comments:

Post a Comment