You can configure how the dimension values (also known as facet values) of any given dimension are sorted in refinement lists at run time. You can sort the dimension values either alphabetically, by frequency, or by rank, and in ascending or descending order.

To do this, you use a REST API to specify a sort option and optionally a sort order to apply to all the dimension values in the dimension.

The sort option determines the order of the dimension values with respect to each other. The following sort options are available:

The sort order can be either asc (ascending) or desc (descending). If you do not specify an order, the sort order is ascending for Alphabetical and descending for Frequency and Rank, by default.

In some cases, a combination of sort option and sort order can assign two or more dimension values to the same location in a refinements list. To further sort the dimension values in such cases, you can specify a second sort option and sort order pair.

The sort option and sort order are specified as values of the dimension’s displayConfig parameter, as in the following example:

        "displayConfig": {
            "sort": "freq,desc;alpha,asc"
        },

The example above specifies that dimension values first be sorted in descending order of frequency; any dimension values that require further sorting are then sorted in ascending alphabetical order.

Note: You can specify any number of pairs of sort option and sort order values, but more than two pairs are seldom needed.


Copyright © 1997, 2017 Oracle and/or its affiliates. All rights reserved. Legal Notices