4

In my test SP2013 farm, on a page with OOTB search result webpart, I key in follow query string in browser:

/sites/abc/SitePages/search.aspx?k=NewsArticleDate=2013/6/14..2014/6/15

enter image description here

It seems recognized. However, as you can see in the picture refinement panel, the date format is weird. This "NewsArticleDate" property is storing Date only. The time should be 00:00:00. It makes the search input not matching the results returned.

If I input something like NewsArticleDate:2013/06/14 it will return the items with 2013/06/13T16:00:00Z which is not expected result.

What can I do to fix it?

1

The issue is that property queries written in KQL will disregard the time portion of your query, limiting to full day results only

FAST Search for SharePoint allowed queries with the time portion in Sharepoint 2010 by using FQL, and fortunately you can do this in 2013 and Office 365 as well.

To limit on dates you will use the FQL range operator. The default behavior is to use “greater than” and “equal and less than” if not specified in the query.

    // Return all results greater than or equal to last modified time of 2013-07-17T12:35:57
`/_api/search/query?querytext='*'&refinementfilters='write:range(2013-07-`17T12:35:57.0000000Z,max,from="ge")'`

http://techmikael.blogspot.no/2013/07/limiting-search-results-by-exact-time.html

  • Any way I can make use of OOB search webpart rather than coding with API? – Mark L Jun 17 '14 at 1:25
  • In SP2010 timezone factor is handled but not in SP2013. Not sure why MS keep make our life harder. – Mark L Jun 17 '14 at 2:03
  • When I use the powershell here gallery.technet.microsoft.com/office/…, I found the crawled property value is actually '2013/06/14 00:00:00'. So weird – Mark L Jun 17 '14 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.