Querying against a computed date field
In our application we have a requirement to filter the records against date field. For this, we wrote a computed field which returns date in below format
We added a field expression like below to filter the records which were created after 2016/01/01
queryBuilder.advancedExpression.addFieldExpression('@modifieddate', '>', ['2016/01/01']);
But when we run the code, it is giving results which are even less than mentioned date which implies not giving correct results. Could you please suggest me if I miss anything.
Coveo for Sitecore fields needs to be translated to work properly, did you translate it? You should end up with a field like this: `@fmodifieddate12345`
You should check Coveo Fields Resources Component, it contains methods to translate fields according to your configuration.
- Have you checked that your field is correctly set on the documents?
- Did you follow all of those steps in the Implementing and Configuring a Computed Field in Your Index?
You should check the Working with Fields topic for more information.