Word separators in SharePoint file names

File names that work with search across versions of SharePoint

Agnes Molnar

by Agnes Molnar on 3/24/2014

Share this:
Print

Article Details

Date Revised:
4/16/2014

Applies to:
Microsoft SharePoint, Search, SharePoint, spx


Recently, I got a question about file naming conventions and Search: Which characters can you really use as word breakers, i.e., to replace spaces in file names? (See Susan Hanley's great post about the file naming conventions here.)

For example, let's say you have a file named My Cool Test Document.docx. If you store this document in a file share or upload it to SharePoint and index it, you'll be able to search for the words "cool" or "Test" or "Document," and this document will appear in the result set.

However, it's not that easy. If you use this file name in SharePoint document libraries, you will get the crazy %20 characters in the URL. (Again, see Susan's post for details.) If you simply eliminate the spaces and use plain camel case in the file name--i.e., MyCoolTestDocument.docx)--you won't get the %20. But the search engine will not be able to separate the words, so you won't be able to search on "cool" or other individual words as you could before. Another option is, of course, using some other character instead of spaces. For example, you can use an underscore:  My_Cool_Test_Document.docx.    

Well, I started to do some research and found that this area is not really well documented. So I decided to do some tests myself. I created some "lorem ipsum" documents with different names, including the use of several special characters for replacing the space.

My test details are listed below. Here are the SharePoint versions I tested against:

  • MOSS 2007 Enterprise
  • SharePoint 2010 Enterprise, no FAST
  • FS4SP
  • SharePoint 2013 Enterprise
  • Office 365

Here are the content sources:

  • File share
  • SharePoint document library

The characters I used in file names were:  -   _   .   &   %   +   #

The results are absolutely consistent with Susan's recommendations. Figure 1 shows the results for a file share as the content source.

t1

Figure 1: Content source: file share

Figure 2 shows the test results using a SharePoint document library as the content source.

t2

Figure 2: Content source: SharePoint document library

 In these tables,

YES means that the character works fine as a word breaker

NO means, the character does NOT work as a word breaker. The engine cannot use this character to split the words. For example, the character underscore "_" cannot be used as a word breaker in MOSS 2007, so it's better to use a different character with this old version of SharePoint. I find it quite interesting that "-" is not a word breaker in SharePoint 2013 IF the content source is file share.

Invalid means it's not allowed to use the character in file names in any SharePoint document library.


Topic: Tutorial

Sign in with

Or register