Sunday, March 17, 2013

Avoid Using Dash Sign In File Name and List Data For Better Search Result
 
 
"-" Dash or Minus or hyphen sign, whatever you call it will cause trouble in SharePoint search if you use it in file name or column data.
 
For example, if you have a convention to name your product name like "Hello-A1007.19" and you refere to the name in other word file, your query for
 
hello-a1007
a1007
a1007.19
 
will not return any result. The reason is that SharePoint index engine doesn't break this pattern correctly and the dash sign is a special character in query: It means "excluded" word.
 
So query for "hello-a1007" is actually means query for words "hello" and "1007".
 
Internally the index engine break the "Hello-A1007.19" as "Hello" and "1007.19". Your query must include these two words to get any result back.
 
To avoid this confusion in both the query and index engine, try to avoid using dash sign in any part of your data. Use underscore instead.
 
For example, name the file "Hello_A1007 19". (Replace dot with a white space too. The dot makes the number looks as a real number).
 
The other documents refer to the file as "Hello_A1007 19.doc" too. With this pattern, next queries will work
 
Hello_a1007
Hello_a1007 19
 
However "a1007" will not work, because the word is broken as "Hello_a1007" and "19".
 
Don't use pattern "Hello_A1007_19" if you don't expect end user will include the last part as part of the query. In this pattern the word is broken into as "Hello_A1007_19", so any other query for patial name like "Hello_Al007" will not return results.
 
If you expect end user will use query like "A1007", then the naming must use white spaces instead of other character to seperate the words. For example "Hello A1007 19". Any other character than white space will force the index engine to index it as one word without breaking it.
 
The prinicipal applies to the list data or metadata of documents too.

No comments:

Post a Comment