Date Refiners and Keyword Syntax RRS feed

  • Question

  • Hi guys,

    I'm having a pretty serious problem with date support in the keyword search syntax.

    For example, the following query brings back all the records for the date 2007-01-08:

    Datefield>="2007-01-09T00:00:00.0Z" AND Datefield<="2007-01-09T00:00:00.0Z"

    Further an actual date range query always includes more documents than the dates specified.

    For example should I look at the date range in a refiner and specify the same query using keywords I get different values coming back.

    I'd really appreciate some help on this one.


    Wednesday, February 22, 2012 10:26 AM

All replies

  • You should use the FQL RANGE operator for queries like that. Keep in mind that the dates stored in the search index are always converted to UTC time zone so you'll need to pass UTC date/time values to the query.
    Wednesday, February 22, 2012 10:43 PM
  • Hi Vassili,

    Thanks for your reply.

    I can't use FQL because the query is user generated. FQL is unworkable with normal human beings.

    The issue could very well be the UTC business. If FAST is converting the dates to local time in order to return them (in for example the refiner values) however not converting them to UTC when they are submitted, it could very well cause problems.

    I'll try that and let you know if it worked.


    Thursday, February 23, 2012 8:06 AM
  • Hi Vissili,

    I'm afraid that the UTC suggestion made no difference.

    This seems to be a pretty serious bug in the way that FAST translates keyword queries. Date is very important for the corpus that I'm implementing FAST to search.

    Any suggestions that does not involve scraping keyword search would be much appreciated.


    Thursday, February 23, 2012 8:28 AM
  • Here is some expansion on the problem. The following three queries should be the same but all return different results. Does anyone have any idea what might be going on?

    kpdate>="2006-12-05T23:00:00Z" AND kpdate<="2007-01-09T22:59:59.9999999Z"      Results 534
    kpdate:range(2006-12-05T23:00:00Z,2007-01-09T23:00:00Z, from="GE", to="LE")     Results 462
    RefinementValue for kpdate [2006-12-05T23:00:00Z;2007-01-09T22:59:59.9999999Z]    Results 461

    Thursday, February 23, 2012 10:23 AM
  • Hi Emir,

    The default value for the "to" parameter in the RANGE operator is "LT" which can explain the difference between the number of records returned by the FQL query and refiner.

    My next suggestion would be to use the Query Logger tool on the FAST query server to capture the actual FQL query being executed against the FAST search index.

    Thursday, February 23, 2012 2:34 PM
  • Hi Vassili,

    Thanks for your comment. Microsoft support has been contacted on this matter.

    I'll let you know what the solution is, or if its confirmed to be a bug with the FAST and SharePoint integration.


    Monday, February 27, 2012 8:41 PM
  • Hi Vassili,

    It looks like the solution was simply to clear the index and re-crawl. I'd venture to say that it was due to an index corruption. This is pretty scary since had it been more subtle it could have taken a lot longer to spot.


    • Marked as answer by Emir123123 Friday, March 16, 2012 9:07 AM
    • Unmarked as answer by Emir123123 Wednesday, March 21, 2012 8:58 PM
    Friday, March 16, 2012 9:07 AM
  • Hi,

    I take it back, it only seemed fix. This is very much still a problem, and very much still a mystery.

    A Microsoft Engineer is looking at it at the moment.


    Wednesday, March 21, 2012 8:58 PM