typedef struct {
Odr_int *numberOfRecords;
+ char *resultCountPrecision;
char * resultSetId;
Odr_int *resultSetIdleTime;
res->extraResponseData_buf = rr.extra_response_data;
res->extraResponseData_len = strlen(rr.extra_response_data);
}
- if (rr.estimated_hit_count || rr.partial_resultset)
+ if (strcmp(res->srw_version, "2.") > 0)
+ {
+ if (rr.estimated_hit_count)
+ srw_res->resultCountPrecision =
+ odr_strdup(assoc->encode, "estimate");
+ else if (rr.partial_resultset)
+ srw_res->resultCountPrecision =
+ odr_strdup(assoc->encode, "minimum");
+ else
+ srw_res->resultCountPrecision =
+ odr_strdup(assoc->encode, "exact");
+ }
+ else if (rr.estimated_hit_count || rr.partial_resultset)
{
yaz_add_srw_diagnostic(
assoc->encode,
odr_malloc(o, sizeof(*res));
res->numberOfRecords = 0;
+ res->resultCountPrecision = 0;
res->resultSetId = 0;
res->resultSetIdleTime = 0;
res->records = 0;
else if (match_xsd_integer(ptr, "numberOfRecords", o,
&res->numberOfRecords))
;
+ else if (match_xsd_string(ptr, "resultCountPrecision", o,
+ &res->resultCountPrecision))
+ ;
else if (match_xsd_string(ptr, "resultSetId", o,
&res->resultSetId))
;
yaz_srw_diagnostics(o, rptr, &res->diagnostics,
&res->num_diagnostics, client_data, ns);
}
+ if (res->resultCountPrecision)
+ add_xsd_string(ptr, "resultCountPrecision",
+ res->resultCountPrecision);
}
else if ((*p)->which == Z_SRW_explain_request)
{
sr->u.response = (Z_SRW_searchRetrieveResponse *)
odr_malloc(o, sizeof(*sr->u.response));
sr->u.response->numberOfRecords = 0;
+ sr->u.response->resultCountPrecision = 0;
sr->u.response->resultSetId = 0;
sr->u.response->resultSetIdleTime = 0;
sr->u.response->records = 0;