locked
Search query builder filter on "Now" RRS feed

  • Question

  • I m using search results web part and try to filter result based on current date and time, I can use "Today" to filter results on today's date but I want to use time as well, I am using a pre configured managed property "RefinableDateTime00" 
    Wednesday, April 6, 2016 2:48 AM

Answers

  • Hi Shafaqat,

    When you use the [Today] in the search query, you only can use [Today] separately. It cannot be combined with the time.

    There is a workaround. If you want to filter current date and time, you could use the time format below and change to the current date. For example: 2016-04-11T03:00:00.

    More reference:

    Keyword Query Language (KQL) syntax reference.

    https://msdn.microsoft.com/en-us/library/ee558911(v=office.15).aspx

    Best regards,

    Sara Fan


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by Victoria Xia Wednesday, April 13, 2016 9:32 AM
    • Marked as answer by Victoria Xia Friday, April 15, 2016 12:47 AM
    Monday, April 11, 2016 1:39 AM

All replies

  • Hi,

    Is there any updates? I have the same issue.

    Thursday, April 7, 2016 1:28 AM
  • no, still looking for solution.
    Thursday, April 7, 2016 2:11 AM
  • Hi Shafaqat,

    If you want to filter specific time in the search results web part, you could add the search query like below:

    Managedproperty=”2016-04-04T10:00:00”

    It supports the following datetime formats in the search query builder.

    YYYY-MM-DD

    YYYY-MM-DDThh:mm:ss

    YYYY-MM-DDThh:mm:ssZ

    YYYY-MM-DDThh:mm:ssfrZ

    For more detailed information, you could refer to the article below.

    Keyword Query Language (KQL) syntax reference.

    https://msdn.microsoft.com/en-us/library/ee558911(v=office.15).aspx

    Best regards,

    Sara Fan


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.


    • Edited by Sara Fan Thursday, April 7, 2016 2:22 AM
    Thursday, April 7, 2016 2:22 AM
  • as per my question, I want to filter on the current date and time, I don't have a specific date.
    Thursday, April 7, 2016 2:27 AM
  • Hi Shafaqat,

    When you use the [Today] in the search query, you only can use [Today] separately. It cannot be combined with the time.

    There is a workaround. If you want to filter current date and time, you could use the time format below and change to the current date. For example: 2016-04-11T03:00:00.

    More reference:

    Keyword Query Language (KQL) syntax reference.

    https://msdn.microsoft.com/en-us/library/ee558911(v=office.15).aspx

    Best regards,

    Sara Fan


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by Victoria Xia Wednesday, April 13, 2016 9:32 AM
    • Marked as answer by Victoria Xia Friday, April 15, 2016 12:47 AM
    Monday, April 11, 2016 1:39 AM