Hyphen, underscore or space? Which one is the best for SharePoint Search?
I was at a client today and I got a very interesting question about how should users name their files. There were many rumors that underscores were the best, since SharePoint knows to split the words up after an underscore. I didn’t have an immediate answer about it, but let’s test it out!
I have uploaded three files to SharePoint with content that makes no sense, so the search only searches on the title of the file. Here are the names of the three files:
- Vlad is the best SharePoint Administrator ever
- Vlad_is_the_best_SharePoint_Administrator_Ever
- vlad-is-the-best-sharepoint-administrator-ever
So, after 30 minutes, I decided to search “SharePoint Administrator” without the quotes! Here is the result:
As you can see, all 3 results have been returned, however the only difference is that SharePoint was able to find the two words in the URL as well for the “Space” and “underscore” options!
Now let’s try with quotes around “SharePoint Administrator”. We can see that the results are similar to the one before, however only the result with a space was bolded by SharePoint. SharePoint found the word with a space in the URL, even if there was a space or underscore.
However, if we search for “SharePoint_Administrator” without the quotes, we only get the one that actually has the underscores in the title name!
However, I have never seen anyone actually use underscores when doing a search. But if your users do it, it’s a good to know!
Conclusion
After testing, I believe that spaces are the best option for your filenames, but if you really don’t want to use spaces in your filenames, use underscores! Never use hyphens!
Leave a comment and don’t forget to like the Absolute SharePoint Blog Page on Facebook and to follow me on Twitter here for the latest news and technical articles on SharePoint. Also, don’t forget to check out SharePoint Community.Net for more great SharePoint Content.