X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fidzebra%2Fapi.h;h=88d9fecd334761e1fd07f9f8bbdf9d3f36273965;hb=6acd2e140d59433a002f2f1890cb4a6e25895c68;hp=e2bddc2918e60db94d68456f07872bf1eb5def23;hpb=3f385c9ee5fea1f18f200a598747c9b385eee9d8;p=idzebra-moved-to-github.git diff --git a/include/idzebra/api.h b/include/idzebra/api.h index e2bddc2..88d9fec 100644 --- a/include/idzebra/api.h +++ b/include/idzebra/api.h @@ -1,4 +1,4 @@ -/* $Id: api.h,v 1.27 2005-06-22 19:42:38 adam Exp $ +/* $Id: api.h,v 1.31 2005-12-09 11:33:32 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -129,7 +129,7 @@ void zebra_filter_info(ZebraService zs, void *cd, one handle is sufficient */ YAZ_EXPORT -ZebraHandle zebra_open(ZebraService zs); +ZebraHandle zebra_open(ZebraService zs, Res res); /** \brief Destroys Zebra session handle. @@ -168,14 +168,6 @@ char *zebra_errAdd(ZebraHandle zh); YAZ_EXPORT void zebra_result(ZebraHandle zh, int *code, char **addinfo); -/** - \brief Clears last error. - \param zh zebra session handle. -*/ -YAZ_EXPORT -void zebra_clearError(ZebraHandle zh); - - /** \brief Set limit before Zebra does approx hit count \param zh session handle @@ -245,11 +237,39 @@ int zebra_deleteResultSet(ZebraHandle zh, int function, int *statuses); +/** + \brief returns number of term info terms assocaited with result set + \param zh session handle + \param setname result set name + \param num_terms number of terms returned in this integer + This function is used in conjunction with zebra_result_set_term_info. + If operation was successful, ZEBRA_OK is returned; otherwise + ZEBRA_FAIL is returned (typically non-existing setname) +*/ YAZ_EXPORT ZEBRA_RES zebra_result_set_term_no(ZebraHandle zh, const char *setname, int *num_terms); +/** + \brief returns information about a term assocated with a result set + \param zh session handle + \param setname result set name + \param no the term we want to know about (0=first, 1=second,..) + \param count the number of occurrences of this term, aka hits (output) + \param approx about hits: 0=exact,1=approx (output) + \param termbuf buffer for term string (intput, output) + \param termlen size of termbuf (input=max, output=actual length) + \param term_ref_id if non-NULL *term_ref_id holds term reference + + Returns information about one search term associated with result set. + Use zebra_result_set_term_no to read total number of terms associated + with result set. If this function can not return information, + due to no out of range or bad result set name, ZEBRA_FAIL is + returned. + The passed termbuf must be able to hold at least *termlen characters. + Upon completion, *termlen holds actual length of search term. +*/ YAZ_EXPORT ZEBRA_RES zebra_result_set_term_info(ZebraHandle zh, const char *setname, int no, zint *count, int *approx, @@ -267,13 +287,15 @@ ZEBRA_RES zebra_result_set_term_info(ZebraHandle zh, const char *setname, \param num_entries number of terms requested / returned \param entries list of resulting terms (ODR allocated) \param is_partial upon return 1=partial, 0=complete + \param setname limit scan by this set (NULL means no limit) */ YAZ_EXPORT ZEBRA_RES zebra_scan(ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, oid_value attributeset, int *position, int *num_entries, ZebraScanEntry **entries, - int *is_partial); + int *is_partial, + const char *setname); /** \brief performs Scan (taking PQF string) @@ -284,11 +306,12 @@ YAZ_EXPORT ZEBRA_RES zebra_scan(ZebraHandle zh, ODR stream, \param num_entries number of terms requested / returned \param entries list of resulting terms (ODR allocated) \param is_partial upon return 1=partial, 0=complete + \param setname limit scan by this set (NULL means no limit) */ YAZ_EXPORT ZEBRA_RES zebra_scan_PQF(ZebraHandle zh, ODR stream, const char *query, int *position, int *num_entries, ZebraScanEntry **entries, - int *is_partial); + int *is_partial, const char *setname); /** \brief authenticate user. Returns 0 if OK, != 0 on failure @@ -405,11 +428,6 @@ ZEBRA_RES zebra_delete_record(ZebraHandle zh, int force_update); YAZ_EXPORT -int zebra_resultSetTerms(ZebraHandle zh, const char *setname, - int no, zint *count, - int *type, char *out, size_t *len); - -YAZ_EXPORT ZEBRA_RES zebra_sort(ZebraHandle zh, ODR stream, int num_input_setnames, const char **input_setnames, @@ -482,7 +500,11 @@ YAZ_END_CDECL * \section intro_sec Introduction * * Zebra is a search engine for structure data, such as XML, MARC - * and others. The following chapters briefly describe each of + * and others. + * + * API users should read the api.h for all the public definitions. + * + * The remaining sections briefly describe each of * Zebra major modules/components. * * \section util Base Utilities