I'm using 8.2 Update-3 with the Azure Toolkit 1.1, deployed to Web App. I've got a template with a Date field on it, and I took a search class that works with Lucene and Solr like this:
[IndexField("date start")]
public DateTime DateStart { get; set; }
And the query expression:
DateTime time;
// ...
.Where(i => i.DateStart >= time)
.OrderBy(i => i.DateStart);
When I run this with Azure Search I get this exception:
System.NotSupportedException: The constant part of the 'GreaterThanOrEqualNode' was expected to be of type 'System.DateTimeOffset', but was of type 'System.DateTime'.
So I converted my result class property and time
variable to DateTimeOffset
. Then I got this exception instead:
Sitecore.ContentSearch.Azure.Http.Exceptions.AzureSearchServiceRESTCallException: {"error":{"code":"","message":"Invalid expression: Unsupported function call: search.ismatchscoring. This function is not supported in this API version.\r\nParameter name: $filter"}}
And this one:
System.NotSupportedException: IndexFieldUtcDateTimeOffsetValueConverter cannot convert from System.DateTime. at System.ComponentModel.TypeConverter.GetConvertFromException(Object value) at System.ComponentModel.TypeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value) at Sitecore.ContentSearch.Azure.Converters.CloudIndexFieldStorageValueFormatter.ReadFromIndexStorageBase(Object indexValue, String fieldName, Type destinationType)
Am I doing date mapping wrong or is this just a limitation of the Azure Search provider or service?
Edit: found the actual search expression in App Insights:
ERROR Azure Search Error [Index=sitecore_web_index]
ERROR:Error in the request URI, headers, or body Search expression:&search=language_1:(en)&$filter=not search.ismatchscoring('name__:(__Standard Values)', null, 'full', null) and date_start ge 2017-05-17T04:55:13.340Z and (templatesimplemented__/any(t:t eq '{DFFD8BFE-9C7E-4033-AD70-6C600088A9E6}')) and latestversion_1&queryType=full
Weirdly, the unsupported ismatchscoring
is apparently coming from .Where(i => i.Name != Sitecore.Constants.StandardValuesItemName)
and not the date.