YAZ
5.34.0
|
Implements ZOOM C query interface. More...
#include <assert.h>
#include <string.h>
#include <errno.h>
#include "zoom-p.h"
#include <yaz/yaz-util.h>
#include <yaz/xmalloc.h>
#include <yaz/log.h>
#include <yaz/pquery.h>
#include <yaz/cql.h>
#include <yaz/ccl.h>
#include <yaz/sortspec.h>
Go to the source code of this file.
Data Structures | |
struct | ZOOM_query_p |
Macros | |
#define | SORT_STRATEGY_Z3950 0 |
#define | SORT_STRATEGY_TYPE7 1 |
#define | SORT_STRATEGY_CQL 2 |
#define | SORT_STRATEGY_SRU11 3 |
#define | SORT_STRATEGY_EMBED 4 |
#define | SORT_STRATEGY_SOLR 5 |
Functions | |
static int | generate (ZOOM_query s) |
const char * | ZOOM_query_get_sru11 (ZOOM_query s) |
Z_Query * | ZOOM_query_get_Z_Query (ZOOM_query s) |
Z_SortKeySpecList * | ZOOM_query_get_sortspec (ZOOM_query s) |
const char * | ZOOM_query_get_query_string (ZOOM_query s) |
void | ZOOM_query_get_hash (ZOOM_query s, WRBUF w) |
static char * | cql2pqf (ZOOM_connection c, const char *cql) |
ZOOM_query_create (void) | |
ZOOM_query_destroy (ZOOM_query s) | |
ZOOM_query_addref (ZOOM_query s) | |
ZOOM_query_prefix (ZOOM_query s, const char *str) | |
ZOOM_query_cql (ZOOM_query s, const char *str) | |
ZOOM_query_cql2rpn (ZOOM_query s, const char *str, ZOOM_connection conn) | |
ZOOM_query_ccl2rpn (ZOOM_query s, const char *str, const char *config, int *ccl_error, const char **error_string, int *error_pos) | |
ZOOM_query_sortby (ZOOM_query s, const char *criteria) | |
ZOOM_query_sortby2 (ZOOM_query s, const char *strategy, const char *criteria) | |
Implements ZOOM C query interface.
Definition in file zoom-query.c.
#define SORT_STRATEGY_CQL 2 |
Definition at line 28 of file zoom-query.c.
#define SORT_STRATEGY_EMBED 4 |
Definition at line 30 of file zoom-query.c.
#define SORT_STRATEGY_SOLR 5 |
Definition at line 31 of file zoom-query.c.
#define SORT_STRATEGY_SRU11 3 |
Definition at line 29 of file zoom-query.c.
#define SORT_STRATEGY_TYPE7 1 |
Definition at line 27 of file zoom-query.c.
#define SORT_STRATEGY_Z3950 0 |
Definition at line 26 of file zoom-query.c.
|
static |
Definition at line 160 of file zoom-query.c.
References cql_parser_create(), cql_parser_destroy(), cql_parser_result(), cql_parser_string(), cql_strerror(), cql_transform(), cql_transform_close(), cql_transform_error(), cql_transform_open_fname(), wrbuf_alloc(), wrbuf_cstr(), wrbuf_destroy(), wrbuf_vp_puts(), xstrdup, ZOOM_connection_option_get(), ZOOM_ERROR_CQL_PARSE, ZOOM_ERROR_CQL_TRANSFORM, and ZOOM_set_error().
Referenced by ZOOM_query_cql2rpn().
|
static |
Definition at line 46 of file zoom-query.c.
References Z_External::cql, Z_External::descriptor, Z_External::direct_reference, ZOOM_query_p::full_query, Z_External::indirect_reference, odr_malloc(), odr_oiddup(), ZOOM_query_p::odr_query, odr_reset(), odr_strdup(), p_query_rpn(), ZOOM_query_p::query_string, ZOOM_query_p::query_type, ZOOM_query_p::sort_spec, ZOOM_query_p::sort_strategy, SORT_STRATEGY_CQL, SORT_STRATEGY_EMBED, SORT_STRATEGY_SOLR, SORT_STRATEGY_SRU11, SORT_STRATEGY_TYPE7, ZOOM_query_p::sru11_sort_spec, Z_Query::type_1, Z_Query::type_104, Z_External::u, Z_Query::u, Z_External::which, Z_Query::which, wrbuf_cstr(), wrbuf_puts(), wrbuf_rewind(), yaz_oid_userinfo_cql, yaz_sort_spec_to_cql(), yaz_sort_spec_to_solr_sortkeys(), yaz_sort_spec_to_srw_sortkeys(), yaz_sort_spec_to_type7(), Z_External_CQL, ZOOM_query_p::z_query, Z_Query_type_1, and Z_Query_type_104.
Referenced by ZOOM_query_cql(), ZOOM_query_prefix(), and ZOOM_query_sortby2().
ZOOM_query_addref | ( | ZOOM_query | s | ) |
Definition at line 248 of file zoom-query.c.
Referenced by ZOOM_connection_scan1(), and ZOOM_connection_search().
ZOOM_query_ccl2rpn | ( | ZOOM_query | s, |
const char * | str, | ||
const char * | config, | ||
int * | ccl_error, | ||
const char ** | error_string, | ||
int * | error_pos | ||
) |
Definition at line 306 of file zoom-query.c.
References ccl_err_msg(), ccl_find_str(), ccl_pquery(), ccl_qual_buf(), ccl_qual_mk(), ccl_qual_rm(), ccl_rpn_delete(), wrbuf_alloc(), wrbuf_cstr(), wrbuf_destroy(), and ZOOM_query_prefix().
ZOOM_query_cql | ( | ZOOM_query | s, |
const char * | str | ||
) |
Definition at line 264 of file zoom-query.c.
References generate(), xfree, xstrdup, and Z_Query_type_104.
ZOOM_query_cql2rpn | ( | ZOOM_query | s, |
const char * | str, | ||
ZOOM_connection | conn | ||
) |
Definition at line 280 of file zoom-query.c.
References cql2pqf(), xfree, ZOOM_connection_create(), ZOOM_connection_destroy(), and ZOOM_query_prefix().
ZOOM_query_create | ( | void | ) |
Definition at line 213 of file zoom-query.c.
References ZOOM_query_p::full_query, odr_createmem(), ODR_ENCODE, ZOOM_query_p::odr_query, ZOOM_query_p::odr_sort_spec, ZOOM_query_p::query_string, ZOOM_query_p::refcount, ZOOM_query_p::sort_spec, ZOOM_query_p::sort_strategy, SORT_STRATEGY_Z3950, ZOOM_query_p::sru11_sort_spec, wrbuf_alloc(), xmalloc, and ZOOM_query_p::z_query.
Referenced by ZOOM_connection_scan(), ZOOM_connection_search_pqf(), and ZOOM_resultset_sort1().
ZOOM_query_destroy | ( | ZOOM_query | s | ) |
Definition at line 230 of file zoom-query.c.
References odr_destroy(), wrbuf_destroy(), and xfree.
Referenced by resultset_destroy(), ZOOM_connection_remove_task(), ZOOM_connection_scan(), ZOOM_connection_search_pqf(), and ZOOM_scanset_destroy().
void ZOOM_query_get_hash | ( | ZOOM_query | s, |
WRBUF | w | ||
) |
Definition at line 144 of file zoom-query.c.
References ZOOM_query_p::query_string, ZOOM_query_p::query_type, ZOOM_query_p::sort_spec, ZOOM_query_p::sort_strategy, wrbuf_printf(), wrbuf_puts(), and yaz_sort_spec_to_type7().
Referenced by ZOOM_memcached_resultset().
const char* ZOOM_query_get_query_string | ( | ZOOM_query | s | ) |
Definition at line 139 of file zoom-query.c.
References ZOOM_query_p::full_query, and wrbuf_cstr().
Referenced by ZOOM_connection_srw_send_scan(), and ZOOM_connection_srw_send_search().
Z_SortKeySpecList* ZOOM_query_get_sortspec | ( | ZOOM_query | s | ) |
Definition at line 134 of file zoom-query.c.
References ZOOM_query_p::sort_spec, ZOOM_query_p::sort_strategy, and SORT_STRATEGY_Z3950.
Referenced by ZOOM_connection_exec_task(), and ZOOM_connection_search().
const char* ZOOM_query_get_sru11 | ( | ZOOM_query | s | ) |
Definition at line 122 of file zoom-query.c.
References ZOOM_query_p::sru11_sort_spec, wrbuf_cstr(), and wrbuf_len.
Referenced by ZOOM_connection_srw_send_search().
Z_Query* ZOOM_query_get_Z_Query | ( | ZOOM_query | s | ) |
Definition at line 129 of file zoom-query.c.
References ZOOM_query_p::z_query.
Referenced by Z3950_send_search(), ZOOM_connection_scan1(), ZOOM_connection_srw_send_scan(), ZOOM_connection_srw_send_search(), and ZOOM_connection_Z3950_send_scan().
ZOOM_query_prefix | ( | ZOOM_query | s, |
const char * | str | ||
) |
Definition at line 255 of file zoom-query.c.
References generate(), xfree, xstrdup, and Z_Query_type_1.
Referenced by ZOOM_connection_scan(), ZOOM_connection_search_pqf(), ZOOM_query_ccl2rpn(), and ZOOM_query_cql2rpn().
ZOOM_query_sortby | ( | ZOOM_query | s, |
const char * | criteria | ||
) |
Definition at line 336 of file zoom-query.c.
References ZOOM_query_sortby2().
Referenced by ZOOM_resultset_sort1().
ZOOM_query_sortby2 | ( | ZOOM_query | s, |
const char * | strategy, | ||
const char * | criteria | ||
) |
Definition at line 342 of file zoom-query.c.
References generate(), odr_reset(), SORT_STRATEGY_CQL, SORT_STRATEGY_EMBED, SORT_STRATEGY_SOLR, SORT_STRATEGY_SRU11, SORT_STRATEGY_TYPE7, SORT_STRATEGY_Z3950, and yaz_sort_spec().
Referenced by ZOOM_query_sortby().