Gravatar for mark.angus@sitesystems.ca

Question by mark, Jan 20, 2015 9:45 AM

How to add ascending and descending sort to occurrences in facet context menu.

Hi, I am using the JSframework and would like to know how to add ascending and descending sort to occurrences in facet context menu. As it is now, it only works on the label option.

Thanks.

2 Replies
Gravatar for vseguin@coveo.com

Answer by Vincent Séguin, Jan 20, 2015 9:49 AM

Hi Mark,

You can follow this documentation : https://developers.coveo.com/display/JsSearch/Facet+Component and change the value of "data-available-sorts" property.

Gravatar for mark.angus@sitesystems.ca

Comment by mark, Jan 20, 2015 10:05 AM

Hi Vincent, I added data-available-sorts="occurrences,label,alphaAscending,alphaDescending" but when Occurrences is high lighted in the menu, Ascending/Descending is disabled.

Is there anything else I am missing?

Thanks.

Gravatar for olamothe@coveo.com

Answer by olamothe, Jan 20, 2015 10:15 AM

Hi,
It is not possible to sort occurences ascending in the index. You can only sort field/computedfield/label using ascending or descending values. All other type of sorts for group by request only support descending. The UI reflect this fact by "graying" out the ascending and descending option in the Facet menu when you sort by occurrences.

Documentation about group by by requests and sort

Ask a question