const char *database = ZOOM_options_get(c->options, "databaseName");
gdu = z_get_HTTP_Request_uri(c->odr_out, c->host_port,
- database,
- c->proxy ? 1 : 0);
+ database, c->proxy_mode);
if (c->sru_mode == zoom_sru_get)
{
Z_SRW_searchRetrieveResponse *res)
{
ZOOM_resultset resultset = 0;
+ int *start, *count;
int i;
NMEM nmem;
ZOOM_Event event;
return zoom_complete;
resultset = c->tasks->u.search.resultset;
+ start = &c->tasks->u.search.start;
+ count = &c->tasks->u.search.count;
syntax = c->tasks->u.search.syntax;
elementSetName = c->tasks->u.search.elementSetName;
schema = c->tasks->u.search.schema;
{
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)
schema, diag);
}
}
+ *count -= i;
+ if (*count < 0)
+ *count = 0;
+ *start += i;
nmem = odr_extract_mem(c->odr_in);
nmem_transfer(odr_getmem(resultset->odr), nmem);
nmem_destroy(nmem);
#endif
#if YAZ_HAVE_XML2
-static void handle_srw_scan_response(ZOOM_connection c,
- Z_SRW_scanResponse *res)
+static zoom_ret handle_srw_scan_response(ZOOM_connection c,
+ Z_SRW_scanResponse *res)
{
NMEM nmem = odr_extract_mem(c->odr_in);
ZOOM_scanset scan;
if (!c->tasks || c->tasks->which != ZOOM_TASK_SCAN)
- return;
+ return zoom_complete;
scan = c->tasks->u.scan.scan;
if (res->num_diagnostics > 0)
ZOOM_options_set_int(scan->options, "number", res->num_terms);
nmem_destroy(nmem);
+ return zoom_complete;
}
#endif
if (sr->which == Z_SRW_searchRetrieve_response)
*cret = handle_srw_response(c, sr->u.response);
else if (sr->which == Z_SRW_scan_response)
- handle_srw_scan_response(c, sr->u.scan_response);
+ *cret = handle_srw_scan_response(c, sr->u.scan_response);
}
}
else
if (sr->which == Z_SRW_searchRetrieve_response)
*cret = handle_srw_response(c, sr->u.response);
else if (sr->which == Z_SRW_scan_response)
- handle_srw_scan_response(c, sr->u.scan_response);
+ *cret = handle_srw_scan_response(c, sr->u.scan_response);
else
ret = -1;
}