My client wants to be able to sort products in order of 4 different fields. I was told there is a way to do this by creating a new computed fields that will take these 4 fields and allow for sorting by this new field.
Would anyone know how this is achieved?
Answer by Vincent Séguin · Nov 17, 2014 at 04:03 PM
Hi Andrew,
I'm not sure of what you want to achieve exactly. Is it possible to describe it in more details?
We have a product that has many fields. We currently have a sort on one fields. Was told there is a way to make a computed field that can take 4 fields and mark the product for sorting. So instead of order by. then order by.. etc, this computed fields can take care of that.
Do you need multi-sort server side (using LINQ) or client side (using the JavaScript Framework)?
What you have been told is probably to use a Query Function, that will create a new numerical field with the four input fields (provided you can come up with a formula that makes sense).
A Computed Field is a computation added to a facet (for example, average of field Y for every facet value of field X), so it wouldn't be of much use here.
Computed field returns value on master but not web on dev server on Azure 1 Answer
computed field is disappearing from index browser when it is blank value 1 Answer
Reference Computed field not showing up in index 2 Answers
add computed field facet to Field drop down in Basic Settings 1 Answer
Can you use a field alias inside of an Underscore results template? 2 Answers