'estimated_hit_count' signals that hits is known to be an estmate
(higher or lower than real hit count). New member 'partial_resultset'
signals that the search was partial (hit count is lower or equal than
real hit count). For Z39.50, the information is stored in resultSetStatus
member of SearchResponse APDU. For SRU, the information is signalled
via SRU diagnostic 59: "Result set created with valid partial results
available".
+Extended the GFS search facility. New member of bend_search_rr
+'estimated_hit_count' signals that hits is known to be an estmate
+(higher or lower than real hit count). New member 'partial_resultset'
+signals that the search was partial (hit count is lower or equal than
+real hit count). For Z39.50, the information is stored in resultSetStatus
+member of SearchResponse APDU. For SRU, the information is signalled
+via SRU diagnostic 59: "Result set created with valid partial results
+available".
+
--- 2.1.46 2007/01/13
Implemented bug #806: Deal with HTTP clients sending LF in HTTP headers.
--- 2.1.46 2007/01/13
Implemented bug #806: Deal with HTTP clients sending LF in HTTP headers.
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: client.c,v 1.322 2007-01-03 08:42:13 adam Exp $
+ * $Id: client.c,v 1.323 2007-01-16 14:12:37 adam Exp $
*/
/** \file client.c
* \brief yaz-client program
*/
/** \file client.c
* \brief yaz-client program
last_hit_count = *res->resultCount;
if (setnumber >= 0)
printf (", setno %d", setnumber);
last_hit_count = *res->resultCount;
if (setnumber >= 0)
printf (", setno %d", setnumber);
+ putchar('\n');
+ if (res->resultSetStatus)
+ {
+ printf("Result Set Status: ");
+ switch(*res->resultSetStatus)
+ {
+ case Z_SearchResponse_subset:
+ printf("subset"); break;
+ case Z_SearchResponse_interim:
+ printf("interim"); break;
+ case Z_SearchResponse_none:
+ printf("none"); break;
+ case Z_SearchResponse_estimate:
+ printf("estimate"); break;
+ default:
+ printf("%d", *res->resultSetStatus);
+ }
+ putchar('\n');
+ }
display_searchResult (res->additionalSearchInfo);
printf("records returned: %d\n",
*res->numberOfRecordsReturned);
display_searchResult (res->additionalSearchInfo);
printf("records returned: %d\n",
*res->numberOfRecordsReturned);
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* $Id: backend.h,v 1.41 2007-01-03 08:42:14 adam Exp $ */
+/* $Id: backend.h,v 1.42 2007-01-16 14:12:37 adam Exp $ */
char *srw_sortKeys; /* holds SRU/SRW sortKeys info */
char *srw_setname; /* holds SRU/SRW generated resultsetID */
int *srw_setnameIdleTime; /* holds SRU/SRW life-time */
char *srw_sortKeys; /* holds SRU/SRW sortKeys info */
char *srw_setname; /* holds SRU/SRW generated resultsetID */
int *srw_setnameIdleTime; /* holds SRU/SRW life-time */
+ int estimated_hit_count; /* if hit count is estimated */
+ int partial_resultset; /* if result set is partial */
} bend_search_rr;
/* extended present handler. Does not replace bend_fetch. */
} bend_search_rr;
/* extended present handler. Does not replace bend_fetch. */
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: seshigh.c,v 1.108 2007-01-03 08:42:15 adam Exp $
+ * $Id: seshigh.c,v 1.109 2007-01-16 14:12:38 adam Exp $
rr.srw_sortKeys = 0;
rr.srw_setname = 0;
rr.srw_setnameIdleTime = 0;
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;
rr.query = (Z_Query *) odr_malloc (assoc->decode, sizeof(*rr.query));
rr.query->u.type_1 = 0;
srw_res->records = 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));
assoc->init->implementation_name,
odr_prepend(assoc->encode, "GFS", resp->implementationName));
- version = odr_strdup(assoc->encode, "$Revision: 1.108 $");
+ version = odr_strdup(assoc->encode, "$Revision: 1.109 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
resp->implementationVersion = odr_prepend(assoc->encode,
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->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, "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);
}
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);
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 *next = odr_intdup(assoc->encode, 0);
int *none = odr_intdup(assoc->encode, Z_SearchResponse_none);
apdu->which = Z_APDU_searchResponse;
apdu->u.searchResponse = resp;
apdu->which = Z_APDU_searchResponse;
apdu->u.searchResponse = resp;
+ bool_t *sr = odr_intdup(assoc->encode, 1);
int *toget = odr_intdup(assoc->encode, 0);
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);
Z_RecordComposition comp, *compp = 0;
yaz_log (log_requestdetail, "resultCount: %d", bsrt->hits);
{
oident *prefformat;
oid_value form;
{
oident *prefformat;
oid_value form;
+ int *presst = odr_intdup(assoc->encode, 0);
if (!(prefformat = oid_getentbyoid(req->preferredRecordSyntax)))
form = VAL_NONE;
if (!(prefformat = oid_getentbyoid(req->preferredRecordSyntax)))
form = VAL_NONE;
return 0;
resp->numberOfRecordsReturned = toget;
returnedrecs = *toget;
return 0;
resp->numberOfRecordsReturned = toget;
returnedrecs = *toget;
- resp->nextResultSetPosition = next;
- resp->searchStatus = sr;
- resp->resultSetStatus = 0;
resp->presentStatus = presst;
}
else
resp->presentStatus = presst;
}
else
if (*resp->resultCount)
*next = 1;
resp->numberOfRecordsReturned = nulint;
if (*resp->resultCount)
*next = 1;
resp->numberOfRecordsReturned = nulint;
- resp->nextResultSetPosition = next;
- resp->searchStatus = sr;
- resp->resultSetStatus = 0;
resp->presentStatus = 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;
}
resp->additionalSearchInfo = bsrt->search_info;
resultSetStatus [26] IMPLICIT INTEGER{
subset (1),
interim (2),
resultSetStatus [26] IMPLICIT INTEGER{
subset (1),
interim (2),
+ none (3),
+ estimate(4)
+ } OPTIONAL,
presentStatus PresentStatus OPTIONAL,
records Records OPTIONAL,
-- Following two parameters may be used only if version 3 is in force.
presentStatus PresentStatus OPTIONAL,
records Records OPTIONAL,
-- Following two parameters may be used only if version 3 is in force.
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: ztest.c,v 1.84 2007-01-03 08:42:18 adam Exp $
+ * $Id: ztest.c,v 1.85 2007-01-16 14:12:38 adam Exp $
+ rr->estimated_hit_count = 1;