On a per-query basis, you can specify a key on which to sort the records and a sort direction.
<Sort Key="?" Direction="?"> <GeocodeReferencePoint latitude="?" longitude="?"/> </Sort>
Both the attribute name and the sort direction are case sensitive.
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<Request xmlns="http://www.endeca.com/MDEX/conversation/3/0">
<Language>en</Language>
<State>
<Name>AllRecs</Name>
<RecordKind>data</RecordKind>
</State>
<RecordListConfig Id="RecordList" MaxPages="20">
<StateName>AllRecs</StateName>
<RecordsPerPage>10</RecordsPerPage>
<Page>1</Page>
<Sort Key="ModelName" Direction="Ascending"/>
</RecordListConfig>
</Request>
</soapenv:Body>
</soapenv:Envelope>
The example specifies an ascending sort order based on the ModelName attribute.
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 the sort order.
Record 1 (P_Year 1998) Record 2 (P_Year 2010) Record 3 (P_Year 2013) Record 4 (no P_Year property value)If the sort order is reversed to P_Year descending, the new result set would appear in the following order:
Record 3 (P_Year 2013) Record 2 (P_Year 2010) Record 1 (P_Year 1998) Record 4 (no P_Year property value)Thus, Record 4 will always appear last because it has no P_Year attribute assignment.