/*
- * Copyright (C) 1995-2006, Index Data ApS
+ * Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: seshigh.c,v 1.106 2006-12-06 21:35:58 adam Exp $
+ * $Id: seshigh.c,v 1.110 2007-02-24 18:44:54 adam Exp $
*/
/**
* \file seshigh.c
if (conn->io_pending & CS_WANT_WRITE)
assoc->cs_get_mask |= EVENT_OUTPUT;
iochan_setflag(h, assoc->cs_get_mask);
- return 1;
+ return 0;
}
/* we got a complete PDU. Let's decode it */
yaz_log(YLOG_DEBUG, "Got PDU, %d bytes: lead=%02X %02X %02X", res,
else if (r == 1 || r == 3)
{
const char *details = input_schema;
- rr->errcode = YAZ_BIB1_ELEMENT_SET_NAMES_UNSUPP;
+ rr->errcode =
+ YAZ_BIB1_SPECIFIED_ELEMENT_SET_NAME_NOT_VALID_FOR_SPECIFIED_;
if (details)
rr->errstring = odr_strdup(rr->stream, details);
return -1;
rr.srw_sortKeys = 0;
rr.srw_setname = 0;
rr.srw_setnameIdleTime = 0;
+ rr.estimated_hit_count = 0;
+ rr.partial_resultset = 0;
rr.query = (Z_Query *) odr_malloc (assoc->decode, sizeof(*rr.query));
rr.query->u.type_1 = 0;
srw_res->records = 0;
}
}
+ if (rr.estimated_hit_count || rr.partial_resultset)
+ {
+ yaz_add_srw_diagnostic(
+ assoc->encode,
+ &srw_res->diagnostics,
+ &srw_res->num_diagnostics,
+ YAZ_SRW_RESULT_SET_CREATED_WITH_VALID_PARTIAL_RESULTS_AVAILABLE,
+ 0);
+ }
}
}
}
assoc->init->implementation_name,
odr_prepend(assoc->encode, "GFS", resp->implementationName));
- version = odr_strdup(assoc->encode, "$Revision: 1.106 $");
+ version = odr_strdup(assoc->encode, "$Revision: 1.110 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
resp->implementationVersion = odr_prepend(assoc->encode,
bsrr->srw_sortKeys = 0;
bsrr->srw_setname = 0;
bsrr->srw_setnameIdleTime = 0;
+ bsrr->estimated_hit_count = 0;
+ bsrr->partial_resultset = 0;
yaz_log (log_requestdetail, "ResultSet '%s'", req->resultSetName);
if (req->databaseNames)
{
int i;
for (i = 0; i < req->num_databaseNames; i++)
- yaz_log (log_requestdetail, "Database '%s'", req->databaseNames[i]);
+ yaz_log(log_requestdetail, "Database '%s'", req->databaseNames[i]);
}
yaz_log_zquery_level(log_requestdetail,req->query);
Z_SearchResponse *resp = (Z_SearchResponse *)
odr_malloc (assoc->encode, sizeof(*resp));
int *nulint = odr_intdup (assoc->encode, 0);
- bool_t *sr = odr_intdup(assoc->encode, 1);
int *next = odr_intdup(assoc->encode, 0);
int *none = odr_intdup(assoc->encode, Z_SearchResponse_none);
- int returnedrecs=0;
+ int returnedrecs = 0;
apdu->which = Z_APDU_searchResponse;
apdu->u.searchResponse = resp;
}
else
{
+ bool_t *sr = odr_intdup(assoc->encode, 1);
int *toget = odr_intdup(assoc->encode, 0);
- int *presst = odr_intdup(assoc->encode, 0);
Z_RecordComposition comp, *compp = 0;
yaz_log (log_requestdetail, "resultCount: %d", bsrt->hits);
{
oident *prefformat;
oid_value form;
+ int *presst = odr_intdup(assoc->encode, 0);
if (!(prefformat = oid_getentbyoid(req->preferredRecordSyntax)))
form = VAL_NONE;
return 0;
resp->numberOfRecordsReturned = toget;
returnedrecs = *toget;
- resp->nextResultSetPosition = next;
- resp->searchStatus = sr;
- resp->resultSetStatus = 0;
resp->presentStatus = presst;
}
else
if (*resp->resultCount)
*next = 1;
resp->numberOfRecordsReturned = nulint;
- resp->nextResultSetPosition = next;
- resp->searchStatus = sr;
- resp->resultSetStatus = 0;
resp->presentStatus = 0;
}
+ resp->nextResultSetPosition = next;
+ resp->searchStatus = sr;
+ resp->resultSetStatus = 0;
+ if (bsrt->estimated_hit_count)
+ {
+ resp->resultSetStatus = odr_intdup(assoc->encode,
+ Z_SearchResponse_estimate);
+ }
+ else if (bsrt->partial_resultset)
+ {
+ resp->resultSetStatus = odr_intdup(assoc->encode,
+ Z_SearchResponse_subset);
+ }
}
resp->additionalSearchInfo = bsrt->search_info;