SearchResponse with resultSetStatus=subset.
-For estimated hit counts, Zebra returns resultSetStatus=estimtate as
-part of SearchResponse. Requires YAZ 2.1.47 or later.
+For truncations being limited (abort at truncmax terms), zebrasrv returns
+SearchResponse with resultSetStatus=subset.
+
+For estimated hit counts, zebrasrv returns SearchResponse with
+resultSetStatus=estimate.
--- 2.0.8 2007/01/15
-/* $Id: index.h,v 1.191 2007-01-16 15:01:15 adam Exp $
+/* $Id: index.h,v 1.192 2007-01-16 15:31:23 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
char *dbaccesslist;
int errCode;
char *errString;
+ int partial_result;
#if HAVE_SYS_TIMES_H
struct tms tms1;
struct tms tms2;
ZEBRA_RES resultSetAddRPN(ZebraHandle zh, NMEM m, Z_RPNQuery *rpn,
int num_bases, char **basenames,
const char *setname,
- zint *hits, int *estimated_hit_count,
- int *partial_resultset);
+ zint *hits, int *estimated_hit_count);
RSET resultSetRef(ZebraHandle zh, const char *resultSetId);
void resultSetDestroy(ZebraHandle zh, int num_names, char **names,
int *statuses);
char *termz);
+void zebra_set_partial_result(ZebraHandle zh);
+
int zebra_check_res(Res res);
#define FIRST_IN_FIELD_STR "\001^"
-/* $Id: rpnsearch.c,v 1.6 2007-01-15 15:10:17 adam Exp $
+/* $Id: rpnsearch.c,v 1.7 2007-01-16 15:31:23 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
grep_info, &max_pos,
ord_len /* number of "exact" chars */,
grep_handle);
- if (r)
+ if (r == 1)
+ zebra_set_partial_result(zh);
+ else if (r)
yaz_log(YLOG_WARN, "dict_lookup_grep fail %d", r);
}
if (!bases_ok)
yaz_log(log_level_rpn, "dict_lookup_grep: %s", term_tmp);
r = dict_lookup_grep(zh->reg->dict, term_dict, 0, grep_info, max_pos,
0, grep_handle);
- if (r != 0 && r != 1)
+
+ if (r == 1)
+ zebra_set_partial_result(zh);
+ else if (r)
yaz_log(YLOG_WARN, "dict_lookup_grep fail, rel = gt: %d", r);
yaz_log(log_level_rpn, "%d positions", grep_info->isam_p_indx);
return 1;
-/* $Id: zebraapi.c,v 1.243 2007-01-16 15:01:15 adam Exp $
+/* $Id: zebraapi.c,v 1.244 2007-01-16 15:31:23 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
return ZEBRA_OK;
}
+void zebra_set_partial_result(ZebraHandle zh)
+{
+ zh->partial_result = 1;
+}
+
ZEBRA_RES zebra_search_RPN_x(ZebraHandle zh, ODR o, Z_RPNQuery *query,
const char *setname, zint *hits,
int *estimated_hit_count,
assert(setname);
yaz_log(log_level, "zebra_search_rpn");
+ zh->partial_result = 0;
+
if (zebra_begin_read(zh) == ZEBRA_FAIL)
return ZEBRA_FAIL;
r = resultSetAddRPN(zh, odr_extract_mem(o), query,
zh->num_basenames, zh->basenames, setname,
- hits, estimated_hit_count, partial_resultset);
+ hits, estimated_hit_count);
+
+ *partial_resultset = zh->partial_result;
zebra_end_read(zh);
return r;
}
-/* $Id: zsets.c,v 1.116 2007-01-16 15:01:15 adam Exp $
+/* $Id: zsets.c,v 1.117 2007-01-16 15:31:23 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
}
-ZEBRA_RES resultSetAddRPN (ZebraHandle zh, NMEM m, Z_RPNQuery *rpn,
- int num_bases, char **basenames,
- const char *setname,
- zint *hits, int *estimated_hit_count,
- int *partial_resultset)
+ZEBRA_RES resultSetAddRPN(ZebraHandle zh, NMEM m, Z_RPNQuery *rpn,
+ int num_bases, char **basenames,
+ const char *setname,
+ zint *hits, int *estimated_hit_count)
{
ZebraSet zebraSet;
int i;
*hits = 0;
*estimated_hit_count = 0;
- *partial_resultset = 0;
zebraSet = resultSetAdd(zh, setname, 1);
if (!zebraSet)