X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=index%2Fzebraapi.c;h=a8e803991a54d646f6052f877d2d126acc27c43f;hp=6ecea626dfa9f2edf8d0e00b978264010f9e4b38;hb=0f563f23506dabd7c84bdb750d4539b2b6cacf02;hpb=95d8b81632dd8067f0f7378b751c7b66352956ea diff --git a/index/zebraapi.c b/index/zebraapi.c index 6ecea62..a8e8039 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $Id: zebraapi.c,v 1.242 2007-01-15 15:10:17 adam Exp $ +/* $Id: zebraapi.c,v 1.243 2007-01-16 15:01:15 adam Exp $ Copyright (C) 1995-2007 Index Data ApS @@ -1015,8 +1015,10 @@ ZEBRA_RES zebra_set_approx_limit(ZebraHandle zh, zint approx_limit) return ZEBRA_OK; } -ZEBRA_RES zebra_search_RPN(ZebraHandle zh, ODR o, Z_RPNQuery *query, - const char *setname, zint *hits) +ZEBRA_RES zebra_search_RPN_x(ZebraHandle zh, ODR o, Z_RPNQuery *query, + const char *setname, zint *hits, + int *estimated_hit_count, + int *partial_resultset) { ZEBRA_RES r; @@ -1027,19 +1029,27 @@ ZEBRA_RES zebra_search_RPN(ZebraHandle zh, ODR o, Z_RPNQuery *query, assert(hits); assert(setname); yaz_log(log_level, "zebra_search_rpn"); - zh->hits = 0; - *hits = 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); + zh->num_basenames, zh->basenames, setname, + hits, estimated_hit_count, partial_resultset); zebra_end_read(zh); - *hits = zh->hits; return r; } +ZEBRA_RES zebra_search_RPN(ZebraHandle zh, ODR o, Z_RPNQuery *query, + const char *setname, zint *hits) +{ + int estimated_hit_count; + int partial_resultset; + return zebra_search_RPN_x(zh, o, query, setname, hits, + &estimated_hit_count, + &partial_resultset); +} + ZEBRA_RES zebra_records_retrieve(ZebraHandle zh, ODR stream, const char *setname, Z_RecordComposition *comp, @@ -2387,6 +2397,7 @@ ZEBRA_RES zebra_search_PQF(ZebraHandle zh, const char *pqf_query, Z_RPNQuery *query; ODR odr; + ZEBRA_CHECK_HANDLE(zh); odr = odr_createmem(ODR_ENCODE);