November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
What type are you seaching for? Can you show a little bit more of your code where the search variable is initialized?
Hi Mattias
All I have so far is the below:
var search = SearchClient.Instance.Search<BaseVariant>(); search = filters.Aggregate(search, (current, filterBuilder) => current.Filter(filterBuilder)); SearchResults<BaseVariant> results = null; var prices = new List<NumericRange> { new NumericRange(0, 500) }; results = search.RangeFacetFor(x => x.SalePrice, prices.ToArray()).Take(0).GetResult();
The BaseVariant class has an extension method called SalePrice, which I ensure is indexed.
Thanks
Calling GetResult() would execute your query towards FINDs REST service. If you remove GetResult, you only have a query that never is executed, hence the error/no error.
Your range facet looks correct, can you running GetResult without the filter (2nd line)?
What type is your SalePrice field?
Hi Mari
Without the filter, it works. Having added the filter back in, it still works! Very strange, but it appears to work.
Thanks
Rob
If BaseVariant is an EPiServer Content Type, try using GetContentResult instead of GetResult.
Whenever I try to get a RangeFacet from Find, I'm getting a 400 Bad Request as response. My search is:
If I remove the GetResult() I no longer get the error, but I have no clue why I do get it when I try and get the result.
Anyone have any advice?
Thanks