Question

I have a KeywordQuery that is sorting using the StartDate (managed propery: StartDateOWSDATE). However it does not recognize StartDate in the QueryText.

Error: We didn't understand your search terms. Make sure you're using the proper syntax.

This is working:

KeywordQuery.SortList.Add("StartDateOWSDATE", SortDirection.Descending);

This is NOT working:

KeywordQuery.QueryText += " StartDateOWSDATE<=Today AND EndDateOWSDATE>Today"
Was it helpful?

Solution

As mentioned by Mathew the managed property you are referencing should be text only. You need to have refinable, sortable managed property to use in your query. There are multiple refinable properties like refinabledate00 to refinabledateXX which are already available in site collection schema, you can re- purpose this property by mapping relevant crawled property in your case what ever crawled property currently mapped with startdateOWSDATE. Scope of this is limited to site collection, create the managed property in search service application, if you want the property in all sites.

refer this

OTHER TIPS

Automatically generated Managed Properties are always Text regardless of the base property type. If you want Date type you have to create it yourself either in the SSA or in the site/site collection.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top