YAZ
5.34.0
|
Header for SortSpec parsing. More...
Go to the source code of this file.
Functions | |
Z_SortKeySpecList * | yaz_sort_spec (ODR odr, 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_srw_sortkeys_to_sort_spec (const char *srw_sortkeys, WRBUF w) |
int | yaz_sort_spec_to_solr_sortkeys (Z_SortKeySpecList *sksl, WRBUF w) |
int | yaz_solr_sortkeys_to_sort_spec (const char *srw_sortkeys, WRBUF w) |
Header for SortSpec parsing.
Definition in file sortspec.h.
int yaz_solr_sortkeys_to_sort_spec | ( | const char * | srw_sortkeys, |
WRBUF | w | ||
) |
Definition at line 392 of file sortspec.c.
References nmem_create(), nmem_destroy(), nmem_strsplit(), nmem_strsplitx(), wrbuf_putc, wrbuf_puts(), and yaz_matchstr().
Z_SortKeySpecList* yaz_sort_spec | ( | ODR | odr, |
const char * | arg | ||
) |
parse sort spec string
odr | memory for result |
arg | sort spec string |
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 | ||
) |
Definition at line 135 of file sortspec.c.
References odr_oct::buf, Z_SortKeySpec::caseSensitivity, Z_SortElement::generic, odr_oct::len, Z_SortKeySpec::missingValueData, Z_SortKeySpecList::num_specs, Z_SortKeySpec::sortElement, Z_SortKey::sortField, Z_SortKeySpec::sortRelation, Z_SortKeySpecList::specs, Z_SortKeySpec::u, Z_SortElement::u, Z_SortKey::u, Z_SortKeySpec::which, Z_SortElement::which, Z_SortKey::which, wrbuf_puts(), wrbuf_write(), 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 generate().
int yaz_sort_spec_to_solr_sortkeys | ( | Z_SortKeySpecList * | sksl, |
WRBUF | w | ||
) |
Definition at line 297 of file sortspec.c.
References Z_SortElement::generic, Z_SortKeySpecList::num_specs, Z_SortKeySpec::sortElement, Z_SortKey::sortField, Z_SortKeySpec::sortRelation, Z_SortKeySpecList::specs, Z_SortElement::u, Z_SortKey::u, Z_SortElement::which, Z_SortKey::which, wrbuf_puts(), Z_SortElement_generic, Z_SortKey_sortAttributes, Z_SortKey_sortField, Z_SortKeySpec_ascending, and Z_SortKeySpec_descending.
Referenced by generate().
int yaz_sort_spec_to_srw_sortkeys | ( | Z_SortKeySpecList * | sksl, |
WRBUF | w | ||
) |
Definition at line 237 of file sortspec.c.
References odr_oct::buf, Z_SortKeySpec::caseSensitivity, Z_SortElement::generic, odr_oct::len, Z_SortKeySpec::missingValueData, Z_SortKeySpecList::num_specs, Z_SortKeySpec::sortElement, Z_SortKey::sortField, Z_SortKeySpec::sortRelation, Z_SortKeySpecList::specs, Z_SortKeySpec::u, Z_SortElement::u, Z_SortKey::u, Z_SortKeySpec::which, Z_SortElement::which, Z_SortKey::which, wrbuf_puts(), wrbuf_write(), 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 generate().
int yaz_sort_spec_to_type7 | ( | Z_SortKeySpecList * | sksl, |
WRBUF | pqf | ||
) |
Definition at line 190 of file sortspec.c.
References Z_AttributeList::attributes, Z_AttributeElement::attributeType, Z_SortElement::generic, Z_SortAttributes::list, Z_AttributeList::num_attributes, Z_SortKeySpecList::num_specs, Z_AttributeElement::numeric, ODR_INT_PRINTF, Z_SortKey::sortAttributes, Z_SortKeySpec::sortElement, Z_SortKey::sortField, Z_SortKeySpec::sortRelation, Z_SortKeySpecList::specs, Z_SortElement::u, Z_SortKey::u, Z_AttributeElement::value, Z_AttributeElement::which, Z_SortElement::which, Z_SortKey::which, wrbuf_insert(), wrbuf_printf(), wrbuf_puts(), Z_AttributeValue_numeric, Z_SortElement_generic, Z_SortKey_sortAttributes, Z_SortKey_sortField, Z_SortKeySpec_ascending, and Z_SortKeySpec_descending.
Referenced by generate(), and ZOOM_query_get_hash().
int yaz_srw_sortkeys_to_sort_spec | ( | const char * | srw_sortkeys, |
WRBUF | w | ||
) |
Definition at line 333 of file sortspec.c.
References nmem_create(), nmem_destroy(), nmem_strsplit_blank(), nmem_strsplitx(), and wrbuf_puts().