From 3b4860c163303e7a0c2ecc3946c4053cb6c72714 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 12 Sep 2013 15:28:21 +0200 Subject: [PATCH] sru_z3950: relays facetList in otherInfo, additional info --- src/filter_sru_to_z3950.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/filter_sru_to_z3950.cpp b/src/filter_sru_to_z3950.cpp index 494a944..882728b 100644 --- a/src/filter_sru_to_z3950.cpp +++ b/src/filter_sru_to_z3950.cpp @@ -30,6 +30,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include #include +#if YAZ_VERSIONL >= 0x50000 +#include +#endif #include #include @@ -597,6 +600,14 @@ bool yf::SRUtoZ3950::Impl::z3950_search_request(mp::Package &package, odr_malloc(odr_en, sizeof(char *)); z_searchRequest->databaseNames[0] = odr_strdup(odr_en, db.c_str()); } +#if YAZ_VERSIONL >= 0x50000 + // yaz_oi_set_facetlist not public in YAZ 4.2.66 + if (sr_req->facetList) + { + Z_OtherInformation **oi = &z_searchRequest->otherInfo; + yaz_oi_set_facetlist(oi, odr_en, sr_req->facetList); + } +#endif Z_Query *z_query = (Z_Query *) odr_malloc(odr_en, sizeof(Z_Query)); z_searchRequest->query = z_query; @@ -637,7 +648,12 @@ bool yf::SRUtoZ3950::Impl::z3950_search_request(mp::Package &package, { return false; } - +#if YAZ_VERSIONL >= 0x50000 + Z_FacetList *fl = yaz_oi_get_facetlist(&sr->additionalSearchInfo); + if (!fl) + fl = yaz_oi_get_facetlist(&sr->otherInfo); + sru_pdu_res->u.response->facetList = fl; +#endif sru_pdu_res->u.response->numberOfRecords = odr_intdup(odr_en, *sr->resultCount); return true; -- 1.7.10.4