I am trying add a query to my SXA Search Scope Query, but it is giving 0 Results. When I check in the Search Logs, I can see the below Log.
?q=((((_path:("64a826d58a374bd9be60bff956a89a47") AND _template:("60beb47fc046428ca9faac88164a8561")) AND expirationdate_tdt:(\[NOW\-1DAY\/DAY\ TO\ *\])) AND _datasource:("sitecore")) AND _latestversion:("1")) AND _val_:__boost&start=0&rows=0&fq=_indexname:(sitecore_master_index)&facet=true&facet.field=_templatename&f._templatename.facet.mincount=1&facet.field=culture_s&f.culture_s.facet.mincount=1&facet.field=parsedcreatedby_s&f.parsedcreatedby_s.facet.mincount=1&facet.field=__smallcreateddate_tdt&f.__smallcreateddate_tdt.facet.mincount=1&wt=xml
The same query returns 0 results in SOLR as well. But when I modify the query to as below, it works.
?q=((((_path:("64a826d58a374bd9be60bff956a89a47") AND _template:("60beb47fc046428ca9faac88164a8561")) AND expirationdate_tdt:([NOW-1DAY/DAY TO *])) AND _datasource:("sitecore")) AND _latestversion:("1")) AND _val_:__boost&start=0&rows=0&fq=_indexname:(sitecore_master_index)&facet=true&facet.field=_templatename&f._templatename.facet.mincount=1&facet.field=culture_s&f.culture_s.facet.mincount=1&facet.field=parsedcreatedby_s&f.parsedcreatedby_s.facet.mincount=1&facet.field=__smallcreateddate_tdt&f.__smallcreateddate_tdt.facet.mincount=1&wt=xml
The only difference I can see is with the expirationdate_tdt field in both queries. The one Sitecore sends to SOLR is build like -- expirationdate_tdt:(\[NOW\-1DAY\/DAY\ TO\ *\])
However, the correct one should be like -- expirationdate_tdt:([NOW-1DAY/DAY TO *])
I have added the correct one as query in SXA Search Scope Query. Does anyone have any idea why it is transformed into the wrong one? Anyway we can stop that from happening?
Thanks Sharad