KQL - Keyword Query Language - Date Time in Queries
KQL - Keyword Query Language - Date Time in Queries - Date Time Managed Property
KQL provides the datetime data type for date and time. The following datetime formats are supported in queries:
- YYYY-MM-DD
- YYYY-MM-DDThh:mm:ss
- YYYY-MM-DDThh:mm:ssZ
- YYYY-MM-DDThh:mm:ssfrZ
EndDate Equals to Selected Date:
EndDate=2015-01-01
EndDate=2015-01-01T12:00:00
EndDate between two dates
EndDate=2015-01-01..2015-01-07
EndDate less than than selected date:
EndDate<=2015-01-07 or EndDate<=2015-01-07
EndDate<=2015-01-07T12:00:00 or EndDate<=2015-01-07
EndDate greater than selected date:
EndDate>=2015-01-07 or EndDate>=2015-01-07 State:"Active"
EndDate>=2015-01-07T12:00:00 or EndDate>=2015-01-07T12:00:00
The KQL Query looks like:
<?xml version="1.0" encoding="utf-8" ?>
<QueryPacket xmlns="urn:Microsoft.Search.Query" Revision="1000">
<Query domain="QDomain">
<SupportedFormats><Format>urn:Microsoft.Search.Response.Document.Document</Format></SupportedFormats>
<Context>
<QueryText language="en-US" type="STRING" >EndDate<=2015-01-07T12:00:00 </QueryText>
</Context>
<Properties><Property name="EndDate" /><Property name="Rank" /><Property name="Title" /><Property name="Author" /><Property name="Size" /><Property name="Path" /><Property name="Description" /><Property name="Write" /><Property name="HitHighlightedSummary" /><Property name="HitHighlightedProperties" /></Properties><SortByProperties><SortByProperty name="Rank" direction="Descending" order="1"/></SortByProperties>
<Range><StartAt>1</StartAt><Count>500</Count></Range>
<EnableStemming>false</EnableStemming>
<TrimDuplicates>true</TrimDuplicates>
<IgnoreAllNoiseQuery>true</IgnoreAllNoiseQuery>
<ImplicitAndBehavior>true</ImplicitAndBehavior>
<IncludeRelevanceResults>true</IncludeRelevanceResults>
<IncludeSpecialTermResults>true</IncludeSpecialTermResults>
<IncludeHighConfidenceResults>true</IncludeHighConfidenceResults>
</Query></QueryPacket>
Comments
Post a Comment