Friday, January 17, 2014

Underscores: SharePoint 2010 Search Worst Enemy or Just a Lesson in Futility

This is a really interesting topic.  I'm hoping that I get some feedback on this blog post based on others experience with SharePoint Search.

At a customer site, we have been troubleshooting a search problem where users were not getting any search results from within a site or a list/library, even when you could clearly see the name of the document contained within it.  We are confident that the Search Service is properly configured (because it is working fine on other sites within the farm) and we confirmed that it is running regular incremental crawls.

The more we dug into the issue, we discovered that it appeared that it had something to do with underscores in the name.  It was quickly apparent that any file under a folder that had an underscore, would not show up in the search results.  This made us question how Microsoft designed their search (why would names with underscores be ruled out?), so we created two test site collections (one created with an underscore in the site name and a second without) so we could test out the search in the following 3 scenarios:
  1. Create a Document Library with an underscore in the name (underscore_library)
  2. Create a Document Library with no underscore (regularlibrary)
  3. Create a Document Library with a space in the name (space library)
Within each of those document libraries, we created 3 folders:
  1. Folder with an underscore in the name (underscore_folder)
  2. Folder with no underscore (folder1)
  3. Folder with a space in the name (space folder)
And within each of those folders, we created two test documents:
  1. Document with an underscore in the name (document_1)
  2. Document with no underscore (document1)
We then ran a full crawl and searched at the site level for a keyword contained within the document.

Wouldn't you know... all our search results showed up?  But we thought it was a problem with the underscores, how could this be???

Ok, we thought, maybe it's one of those things that just needs to get kicked once in a while.. you know... Have you tried turning it OFF and back ON again?

So we decided to run a full crawl on the content source for the user's sites and just like that, all search results then showed up!  I was both elated and disappointed at the same time.  I was happy because the user's search results were now being displayed (and we could mark this ticket closed).. but I was disappointed because this blog post that I had been writing (and the effort to create test site collections) was for naught.

Even though this did the trick for the issue at hand, the question then becomes, what event or change happened to the site and/or the content that would cause it to not get picked up in the incremental?  We did experience a SAN crash last year (after this data was originally created) and this caused us to have corrupted databases that needed to be repaired, but we were not sure this was the reason these files were not getting picked up by the index.  We were at a loss, but I guess sometimes you just have to accept that a "reboot" will often times fix weird Microsoft problems like this and just move on.  No sense burning off a bunch of brain cells to figure every little thing out.  It works - you're a hero - now move along.

I'm always open to ideas, suggestions or perhaps your own experience with similar funky search issues like this one.  I decided to still post this to hopefully remind everyone that sometimes the best solution is the easiest.

If you want to learn more about planning for crawling and federation in SharePoint 2010, we referred to this technet article:

Until next time... stay thirsty my friends!

No comments:

Post a Comment