Index field type not working
I'm creating a computed field which is a Datetime but when I run the index it indexes as a string. ItÂ´s definition is set like this:
on the section of AddComputedIndexField:
The method(PrimaryDate) that gets the field returns a nullable Datetime which I'm reading from a specifics fields withing sitecore and indexing it on a custom computed field. the value of the date is there but it gets indexes as a string a not a date time.
On the admin tool I see the computed field but as a string: @fprimarydate15406 String 2014/01/01@00:00:00
instead it should be looking like: Date/time 01/01/201412:00:00 AM
Any ideas on why it is getting indexed as a string and not by itÂ´s type?
Based on the tutorial, you should add your computed field in the
fields element, not the
fieldnames element. You are mixing computed fields and field names. The two concepts are distinct: https://developers.coveo.com/display/SC201501/Understanding+the+Coveo+Search+Provider%27s+Configuration+File#UnderstandingtheCoveoSearchProvider'sConfigurationFile-ComputedFields
Did you check this topic? https://developers.coveo.com/display/SC201501/Creating+a+Computed+Date+Field It explains pretty well how to do such a computed field. Make sure the value returned by your computed field has the right format.
Let me know how it goes.
Based on the tutorial the return type of a date field should be "datetime"
I'm still not sure why thatÂ´s not working. It still indexes as a string and not a date time type