SharePoint Server 2013: KeywordQuery and searchexecutor not accepting date range for Created date column

Shruti Sharma 21 Reputation points
2021-03-18T11:03:37.257+00:00

Hi,
I'm writing code to run search query through Server Object Model. I'm getting the error message 'We didn't understand your search terms. Make sure they're using proper syntax.', when I pass below query to code.

"Created=3/18/2020..12/31/2021"

This works fine on out of the box search page but not through custom code.
Can someone please help.

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,596 questions
0 comments No comments
{count} votes

Accepted answer
  1. MichaelHan-MSFT 18,021 Reputation points
    2021-03-19T02:28:14.47+00:00

    Hi @Shruti Sharma ,

    For SharePoint KeywordQuery , you could refer to this documentation: https://learn.microsoft.com/en-us/sharepoint/dev/general-development/keyword-query-language-kql-syntax-reference

    You could try to use this code:

    Created>=2020-03-18 AND Created<=2021-12-31  
    

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful