SRU (Search/Retrieval Using URL)

The Sort Context Set (version 1.0)

Index Modifiers   Examples  Indexes/Relations/etc.

  • The sort context set defines a set of index modifiers to be used within a sortby clause
  • The URI for this context set is: info:srw/cql-context-set/1/sort-v1.0
  • The recommended short name is: sort

Note that CQL does not permit index modifiers, except within a sort clause. 

For example in the CQL query:  "author=wolfe sortby title"    'sortby title' is a sort clause;  'title' is an index.  'author', which is the primary index of query,  may not have a modifier, but 'title', which is the index of the sort clause, may. Thus for example, in the CQL query:  "author=wolfe sortby title/ascending"  'ascending' is an index modifier.


Index Modifiers

Modifier

Description

ignoreCase

Case-insensitive sorting: for example, unit and UNIT sort together.

respectCase

Case-sensitive sorting: for example, unit and UNIT sort separately.

ignoreAccents

Accent-insensitive sorting: for example sorensen and sørensen sort together.

respectAccents

Accent-sensitive sorting: for example sorensen and sørensen sort separately.

ascending

Sort in ascending order.

descending

Sort in descending order.

missingOmit

Records that have no value for the specified index are omitted from the sorted result set.

missingFail

Records that have no value for the specified index cause the search/sort operation to fail with the diagnostic info:srw/diagnostic/1/93

missingLow

Records that have no value for the specified index are treated as if they had the lowest possible value, so that they sort first in ascending order and last in descending order.

missingHigh

Records that have no value for the specified index are treated as if they had the highest possible value.

missingValue=value

Records that have no value for the specified index are treated as if they had the specified value.

locale=value

Sort according to the specified locale, which will in general include specifications for whether sorting is case-sensitive or insensitive, how it treats accents, etc. The value is usually of the form C, french, fr_CH, fr_CH.iso88591 or similar.

unicodeCollate=value

Specfies the Unicode collation level. The value should be a small integer as described in the Unicode Collation Algorithm report at www.unicode.org/reports/tr10

Examples

  • dc.creator=plews sortby dc.title/sort.respectCase
    Sort by title, case sensitive

  • dc.creator=plews sortby dc.title/sort.respectCase/sort.descending
    Sort case sensitive and in descending order

  • dc.creator=plews sortby dc.date/sort.missingOmit
    Sort by date: records that have no date field are omitted from the result set.

  • dc.creator=plews sortby dc.date/sort.missingValue=1970
    Sort by date: records that have no date field are sorted as though
    they had a date of 1970.

Indexes

No indexes are defined for this context set.

Relations

No relations are defined for this context set.

Relation Modifiers

No relation modifiers are defined for this context set.

Relation Qualifiers

No relation qualifiers are defined for this context set.

Boolean Modifiers

No boolean modifiers are defined for this context set.