You can specify that the dimension (facet) values of a specified dimension be sorted in refinement lists at run time. The dimension values can be sorted alphabetically, by frequency, or by rank, and in ascending or descending order.
To do this, you 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:
alpha
(alphabetical). Sort dimension values as specified by the applicable language collation. For alphabetic languages, this means alphabetical sorting. For information about sorting by collations, refer to the Oracle Commerce Guided Search Internationalization Guide.freq
(frequency). Sort dimension values by the number of records that are tagged to each.rank
(static rank values). Sort dimension values by their static rank values. For more information, see Configuring static rank values.sig
(sort refinements by their statistical significance values). For information about how to sort refinements by their statistical significance, Dynamic ordering of dimension values in refinement lists.
The sort order can be either ascending or descending. The default sort order is ascending for Alphabetical and descending for Frequency and Rank.
In some cases, a sort option and sort order may assign two or more dimension values 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 to break the tie.
For example, the following illustration shows two dimension values, “Action Sports Cameras” and “Binoculars” that each have 44 records tagged to them; after being assigned the same location in the refinements list by descending order of frequency, they are sorted in ascending alphabetical order:
You configure sort options and sort orders for particular dimensions through the Navigation Cartridge. For information about how to configure the navigation cartridge, refer to the Oracle Commerce Workbench User's Guide.
To configure how the dimension values of a specified dimension are to be ordered at run-time, follow these steps:
Export the configuration of the ATG owner's attributes, using either of the following endpoints:
GET /gsadmin/v1/cloud/attributes/ATG (JSON format)
or
GET /gsadmin/v1/cloud/ attributes/ATG.ZIP (ZIP format)
In the exported
_.json
file, find the attribute for the dimension whose dimension values you want to order. Dynamic ordering of dimension values in refinement lists illustrates how a dimension is configured.Export the configuration of the system owner's attributes, using either of the following endpoints:
GET /gsadmin/v1/cloud/attributes/system (JSON format)
or
GET /gsadmin/v1/cloud/ attributes/system.ZIP (ZIP format)
Copy the dimension attribute that you are interested in from the ATG owner's
_.json
file and paste it into the system owner's_.json
file.In the system owner's
_.json
file, find the dimension attribute that you copied from the ATG owner's _.json file. In this attribute'sdisplayConfig
parameter, specify the sort option and sort order for the dimension values in that dimension; for example:displayConfig": { sort": "freq,desc;alpha,asc" },
Add a parameter specifying that the merge action is update:
"mergeAction" : "update"
Note: The "mergeAction" is necessary only if there is a corresponding definition for this attribute under an owner other than "system".
To import the configuration of the dimension, using either of the following endpoints:
PUT /gsadmin/v1/cloud/attributes/system (JSON format)
or
PUT /gsadmin/v1/cloud/attributes/system (ZIP format)
Publish your Catalog to apply your configuration of the ordering of dimension values. Note that the Publish button is not enabled unless you have made at least one change to your Catalog content.
View your changes in preview to verify that the dimension values are ordered as you intend.
Run a partial update to promote your configuration to the live application
The following excerpt from a
_.json
file illustrates how a dimension is configured.
The dimension is named
camera.color
.
The
displayConfig
parameter specifies that dimension
values in this dimension are sorted in descending order of frequency; and that
ties are sorted in ascending alphabetical order. For example, suppose that two
dimension values, "Action Sports Cameras" and "Binoculars" each have 44 records
tagged to them. After being assigned the same location in the refinements list
by descending order of frequency, they are sorted in ascending alphabetical
order. Thus "Action Sports Cameras" comes immediately before "Binoculars" in
the refinements list.
{ "camera.color": { "isWildcardEnabledInRecordSearch": true, "displayOrder": 4, "displayConfig": { "sort": "freq,desc;alpha,asc" }, "sourcePropertyNames": ["camera.Color of product"], "isAutogen": true, "isRecordSearchEnabled": true, "ecr:type": "dimension", "mergeAction" : "update" } }
Note
Do not modify dimension parameters not discussed in this section unless you are certain that you have complete and accurate knowledge about those parameters.