Recently, I’ve got a question about file naming conventions versus Search: which characters can be really used as word breakers, eg. replacing 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 with name “My Cool Test Document.docx”. If you store this document in a file share or upload to SharePoint and index it, you’ll be able to search for the words “cool” or “Test” or “Document”, and you’ll see this document on the result set.
Anyway, using this file name in SharePoint document libraries will give you the crazy “%20” characters in the URL (see Susan’s post, again).
If we simply eliminate the spaces and uses plain camel case in the file name (MyCoolTestDocument.docx), we won’t get the “%20″s but the search engine will not be able to separate the words.
The third option is, of course, using some other character instead of spaces, for example, underscore, like My_Cool_Test_Document.docx.
Well, I have started to make some research and found that this area is not really well documented so that I decided to make some tests by myself. I created some “lorem ipsum” documents with different names, including several special characters for replacing space.
My test details:
-
SharePoint versions I tested against
- MOSS 2007 Enterprise
- SP 2010 Enterprise, no FAST
- FS4SP
- SP2013 Enterprise
- O365
-
Content sources:
- File share
- SharePoint document library
- Characters used in file names: “-“, “_”, “.”, “&”, “%”, “+”, “#”
The results are absolutely consistent with Susan’s recommendations:
- Content source: file share
Character | MOSS 2007 | SP2010 | FS4SP | SP2013 |
– | yes | yes | yes | NO |
_ | NO | yes | yes | yes |
. | yes | yes | yes | yes |
& | yes | yes | yes | yes |
% | yes | yes | yes | yes |
+ | yes | yes | yes | yes |
# | yes | yes | yes | yes |
- Content source: SharePoint document library
Character | MOSS 2007 | SP2010 | FS4SP | SP2013 | O365 |
– | yes | yes | yes | yes | yes |
_ | NO | yes | yes | yes | yes |
. | yes | yes | yes | yes | yes |
& | invalid | invalid | invalid | invalid | invalid |
% | invalid | invalid | invalid | invalid | invalid |
+ | yes | yes | yes | yes | yes |
# | invalid | invalid | invalid | invalid | invalid |
In these tables, YES means: the character works fine as a word breaker, for example:
NO means, the character does NOT work as a word breaker, the engine cannot split the words by this. For example, the character underscore “_” cannot be used as a word breaker in MOSS 2007, so that it’s better to use a different character on this, old version of SharePoint.
It’s quite interesting, that “-” is not a word breaker on SharePoint 2013 IF the content source is file share.
Invalid means it’s not allowed to use the character in file names in any SP doc library.
One more, last note for MOSS 2007: there are some issues with hit highlighting in MOSS 2007, see an example on the screenshot below:

Leave a Reply