November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
Try parsing the string to a DateTime in the projection:
query.Select(x => new SearchHit { Title = x.SearchTitle, Url = x.SearchHitUrl, Text = x.SearchSummary.AsCropped(200), PublishedDate = x.SearchMetaData["updated_date"].DateTimeValue ?? DateTime.Parse(x.SearchMetaData["updated_date"].StringValue) }).GetResult();
I currently have objects with the following SearchMetaData
Trubble is when trying to get this updated_date. It seems to be saved in a string fromat looking at the index but When I try and get it in the projection I get a "Argument type do not match" error.
I did some testing and the PublishedDate line works, but will always be null.
The Test line will work and give me EPiServer.Find.IndexValue and checking this property on the object will have the date in it's StringValue.
The Test2 line will give me the "Argument type do not match" error.
So my question is. How am I suppose to get the date? I could ofcourse get the hole IndexValue and then get it. But then the question becomes how do I get the value when ordering by date?