X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fzoom-sru.c;h=0185e68b23e6fb400e826882b8296eae00ce8b3f;hp=533c1df6de0c35bd085852a9556c612b3e960ca0;hb=b675ebc81ebe1f2cb7d28b4ce43a51ad5cb39598;hpb=a91467db0bbbaefbaf64410b657a9439104997e0 diff --git a/src/zoom-sru.c b/src/zoom-sru.c index 533c1df..0185e68 100644 --- a/src/zoom-sru.c +++ b/src/zoom-sru.c @@ -165,7 +165,7 @@ zoom_ret ZOOM_connection_srw_send_search(ZOOM_connection c) ZOOM_memcached_search(c, resultset); if (!resultset->setname) - resultset->setname = xstrdup("default"); + resultset->setname = odr_strdup(resultset->odr, "default"); ZOOM_options_set(resultset->options, "setname", resultset->setname); start = &c->tasks->u.search.start; count = &c->tasks->u.search.count; @@ -294,8 +294,33 @@ static zoom_ret handle_srw_response(ZOOM_connection c, { if (res->numberOfRecords) { + Z_OtherInformation *oi = 0; + if (res->facetList) + { + ODR o = c->odr_in; + Z_External *ext = (Z_External *) + odr_malloc(o, sizeof(*ext)); + + ext->which = Z_External_userFacets; + ext->u.facetList = res->facetList; + ext->direct_reference = + odr_oiddup(o, yaz_oid_userinfo_facet_1); + ext->indirect_reference = 0; + ext->descriptor = 0; + oi = (Z_OtherInformation *) odr_malloc(o, sizeof(*oi)); + oi->num_elements = 1; + oi->list = (Z_OtherInformationUnit **) + odr_malloc(o, sizeof(*oi->list)); + oi->list[0] = (Z_OtherInformationUnit *) + odr_malloc(o, sizeof(**oi->list)); + oi->list[0]->category = 0; + oi->list[0]->which = Z_OtherInfo_externallyDefinedInfo; + oi->list[0]->information.externallyDefinedInfo = ext; + } resultset->size = *res->numberOfRecords; - ZOOM_memcached_hitcount(c, resultset); + ZOOM_memcached_hitcount(c, resultset, oi, + res->resultCountPrecision ? + res->resultCountPrecision : "exact"); } resultset->live_set = 2; if (res->suggestions)