I had some custom code performing queries on a Sitecore index that worked perfectly on my local environment with Solr. But when deploying the code to Azure PAAS with Azure search they don't work.
The queries are rather simple and contain (amongst others, just listing the troubled predicates here):
- check a date field to be not older than 30 days
- check if the item is of a certain template (comparing the templateID)
- check if the item is a a certain base template (using the inheritance index field)
We are seeing several issues in the logs:
- the inheritance field apparently cannot be used in a filter on Azure
- our queries get "This_Is_Equal_ConstNode_Return_Nothing" in the search part
- filter on ID is not working (seems that the ID is in uppercase, should be lowercase)
- filter on date is not working ("Specified cast is not valid" error)
- patch the inheritance field to be filterable (this fixed that issue)
- verify if the same code works on the same Sitecore version (9.0.2) without SXA - it does..
- verify if changing my DateTime to DateTimeOffset would help - it doesn't
Any idea what's wrong?