YAZ  5.23.1
Functions
sortspec.c File Reference

Implements SortSpec parsing. More...

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <yaz/matchstr.h>
#include <yaz/z-core.h>
#include <yaz/sortspec.h>
#include <yaz/oid_db.h>
#include <yaz/wrbuf.h>

Go to the source code of this file.

Functions

Z_SortKeySpecListyaz_sort_spec (ODR out, const char *arg)
 parse sort spec string More...
 
int yaz_sort_spec_to_cql (Z_SortKeySpecList *sksl, WRBUF w)
 
int yaz_sort_spec_to_type7 (Z_SortKeySpecList *sksl, WRBUF pqf)
 
int yaz_sort_spec_to_srw_sortkeys (Z_SortKeySpecList *sksl, WRBUF w)
 
int yaz_sort_spec_to_solr_sortkeys (Z_SortKeySpecList *sksl, WRBUF w)
 
int yaz_srw_sortkeys_to_sort_spec (const char *srw_sortkeys, WRBUF w)
 
int yaz_solr_sortkeys_to_sort_spec (const char *solr_sortkeys, WRBUF w)
 

Detailed Description

Implements SortSpec parsing.

Definition in file sortspec.c.

Function Documentation

int yaz_solr_sortkeys_to_sort_spec ( const char *  solr_sortkeys,
WRBUF  w 
)
Z_SortKeySpecList* yaz_sort_spec ( ODR  odr,
const char *  arg 
)

parse sort spec string

Parameters
odrmemory for result
argsort spec string
Returns
Z39.50 SortKeySpecList or NULL on error

The sort spec list is of the form: (field flags)+ where field is either a string or one or more attribute pairs key=value (there must be no blanks in either field of flags). flags is a character list: dD> : descending aA< : ascending (default) iI : ignoreccase / case-insensitive (default) sS : respectcase / case-sensitive ! : abort of key is omitted in result =value : missing value

Examples:

title a

1=4 ia 1=1003 sd

Definition at line 23 of file sortspec.c.

References Z_SortKeySpec::abort, Z_AttributeList::attributes, Z_AttributeElement::attributeSet, Z_AttributeElement::attributeType, odr_oct::buf, Z_SortKeySpec::caseSensitivity, Z_SortElement::generic, Z_SortAttributes::id, odr_oct::len, Z_SortAttributes::list, Z_SortKeySpec::missingValueData, Z_SortKeySpec::null, Z_AttributeList::num_attributes, Z_SortKeySpecList::num_specs, Z_AttributeElement::numeric, odr_atoi(), odr_intdup(), odr_malloc(), odr_nullval(), odr_oiddup(), odr_strdup(), Z_SortKey::sortAttributes, Z_SortKeySpec::sortElement, Z_SortKey::sortField, Z_SortKeySpec::sortRelation, Z_SortKeySpecList::specs, Z_SortKeySpec::u, Z_SortElement::u, Z_SortKey::u, Z_AttributeElement::value, Z_AttributeElement::which, Z_SortKeySpec::which, Z_SortElement::which, Z_SortKey::which, yaz_oid_attset_bib_1, Z_AttributeValue_numeric, Z_SortElement_generic, Z_SortKey_sortAttributes, Z_SortKey_sortField, Z_SortKeySpec_abort, Z_SortKeySpec_ascending, Z_SortKeySpec_caseInsensitive, Z_SortKeySpec_caseSensitive, Z_SortKeySpec_descending, Z_SortKeySpec_missingValueData, and Z_SortKeySpec_null.

Referenced by ZOOM_query_sortby2().

int yaz_sort_spec_to_cql ( Z_SortKeySpecList sksl,
WRBUF  w 
)
int yaz_sort_spec_to_solr_sortkeys ( Z_SortKeySpecList sksl,
WRBUF  w 
)
int yaz_sort_spec_to_srw_sortkeys ( Z_SortKeySpecList sksl,
WRBUF  w 
)
int yaz_sort_spec_to_type7 ( Z_SortKeySpecList sksl,
WRBUF  pqf 
)
int yaz_srw_sortkeys_to_sort_spec ( const char *  srw_sortkeys,
WRBUF  w 
)