Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Looks like the supported types are int, double, short, long and float. Maybe you could parse it if that is possible
.RangeFacetFor(x => (double)x.TestDescimal)
RangeFacetFor gives this error for any field defined as Decimal but works fine with Int and doubles. I am wondering is there any way to work with the decimals. Is it a bug?
We get following error "Cannot create range facet for TestDecimal. Range facets can only be created for numerical types and their nullable counterparts as well as dates."
public class BookProduct : ProductContent
{
[Display(
Name = "RRP",
Description = "The RRP for the book.")]
public virtual int TestInt { get; set; }
[Display(
Name = "RRP",
Description = "The RRP for the book.")]
public virtual decimal TestDecimal { get; set; }
}
-------------------------------------------------
var productContents3 = SearchClient.Instance.Search()
.RangeFacetFor(x => x.TestInt, priceRanges.ToArray())
.GetContentResult();
var productContents2 = SearchClient.Instance.Search()
.RangeFacetFor(x => x.TestDecimal, priceRanges.ToArray())
.GetContentResult();
---------------------------------------------