What are the semantics of SortKey and its subelements, in the SortRequest APDU?Response:
SortKey specifies a single key to sort on.Note: The Sort request allows multiple instances of SortKey and thus multiple keys: -- a major key, secondary key, etc.; an order for each may be specified -- ascending or descending -- as well as case sensitivity and missing value action. But these are outside the scope of SortKey. See related clarifications:Each sort key takes one of three possible forms, which are referred to in the ASN.1 as:
For illustrative purposes let's call them, respectively:
(1) is more easily described last. (2) and (3) correspond respectively to a "retrieval" and "search" view of the record.
- private sort key
- abstract access point
Thus for (2), "field-in-record", you would specify a retrieval element of the record, as defined perhaps by a schema, and specified by an element specification, such as eSpec-1, or by an element set name. The element specification or name should resolve to a single element; if it resolves to several elements, the sort key is not well-defined.
For (3), "abstract access point", you would specify a search attribute, or several; however if several are supplied, then similarly, they should resolve to a single abstract access point.
The "private sort key", (1), is used when the origin and target have a prior agreement about what the supplied key means. For example the client may supply the string 'author', where that string doesn't denote any particular field in the record as defined by the schema, and it isn't an attribute (no attribute set id) but the server knows (because of prior agreement) that that string, when supplied as a private sort key, and when applied to the records in question, refers to a specific field.