Recently I faced with this weird issue when one of my customers reported an issue in one of content search web part. For that user the content search web part would throw the below error:
Interestingly this issue was not reproducible in my machine and so I started checking the logs and found the below error message:
System.ServiceModel.FaultException`1[Microsoft.Office.Server.Search.Administration.SearchServiceApplicationFault]: Query ‘Type:5ab295f9-9aed-4cdf-aa05-fbb693fc85e9 AND DateProperty:12/31/2014..12/30/2015′ failed: syntax error at position 56, Unable to parse ’12/31/2014’ as an absolute date time value.
The error message stated that “12/31/2014” could not be parsed as a valid date time value.
Then I got to know that the user who reported the issue has Portuguese as default browser language and I tried setting up the same in my browser. Voila, the issue got reproduced. Then I checked for most of the other languages such as Russian, Dutch, Chinese, Italian etc. and most of them failed. So tracing the issue in fiddler and little bit of googling, I found that client.svc actually uses the locale of the client browser while parsing the values (you could see the client browser language is send in the Request Header in below screenshot).
Accept-Language: pt-PT, en-GB;
The date value is sent in mm/dd/yyyy format by me and it is not supported by many of the non-English language cultures. So after some googling I found that International date format is yyyy-mm-dd, so this format would be supported by all of the cultures. And so I changed my query to use yyyy-mm-dd date format of value i.e.: DateProperty: 2014-12-31..2015-12-30 and it worked!! (Also yyyy/mm/dd format also works)
Then I did some testing with different browser language culture and this format worked for most of the European languages but failed for Chinese. For users with Chinese browser language , the search did not return any results (no error as well 😦 )
Update: For Chinese browser language , the date range query works for yyyy-mm-dd or yyyy/mm/dd date format.
Leave a Reply to Unnikannan Ayilliath Cancel reply