SharePoint: Search Results are not being returned when we use special characters.

We could face a problem in searching the special characters by using the GET method.

 

For example, I have a document which has the German characters in it. I have indexed the document already. In the URL type the following, and hit enter.

 

https://karthickmain:9091/Search.aspx?k=veröffentlichten

 

Now check the site context search box. It has the word “verffentlichten” missing the “ö” character. This results the invalid search result.

 

If I replace the default search box with my custom one as per the following msdn article that also results the same result

Creating a Site Context Search Box that Uses SharePoint Portal Server Search Results

https://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_sp2003_ta/html/odc_spssearchboxwithportalsearchresults.asp

 

This article uses the JavaScript escape function to encode the URL. But this method doesn’t encode the special characters properly. So we end up with invalid search results.

 

Solution: In the custom search box code, use the “escapeProperly” function which is defined in the ows.js file. This will encode the URL appropriately and will return the expected result.

Comments

  • Anonymous
    August 09, 2010
    Hi, Apart from the URL, how can we search on special characters i.e. if the document or web page contains $29, $49 or #101, #100? OOB it seems share point ignores these characters? is there a file somewhere which can be configured to accept these? thanks, Anuj