About precomputing sort indices on a property

Although users can sort on any record at any time, it is also possible to optimize a property for sort in Developer Studio. This mainly controls the generation of a precomputed sort, and secondarily enables the field to be returned in the API sort keys function.

Sorting functionality allows an Endeca-enabled Web application to define the order of records returned with a query. When making a query request, the application may define a series of sort keys (property/order or dimension/order pairs, where order is either ascending or descending). The MDEX Engine then returns records according to those keys.

All of the records corresponding to a particular navigation state are considered for sorting, not just the records visible in the current request. For example, if a navigation state applies to 100 bottles of wine, all 100 bottles are considered when sorting, even though only the first ten bottles may be returned with the current request. The sort key's data type determines the type of sort that occurs—numeric, alphabetical, geospatial, time, datetime, or duration. If an Endeca record does not include a value for the specified sort key, that record is sorted to the bottom of the list, regardless of whether the sort order is ascending or descending.

Note: An explicit record sort key, specified as part of a MDEX Engine query, takes priority over any other type of record sorting (default sorting and relevance ranking). See Controlling the order of record results for details.

If the Web application does not specify sort order as part of the query, the MDEX Engine returns records in the default sort order, if one has been specified. See Specifying a default record sort order for details.

Record sorting only affects the order of records. It does not affect the ordering of dimensions or dimension values that are returned for query refinement. You use dimension and dimension value ranking to affect the order of dimensions and dimension values.