search
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn 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)
Thanks for your input. We were on early stage of project, we changed type from decimal to double.
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();
---------------------------------------------