X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzebraapi.c;h=5805f9f9a2db310de0d677b39a392bf56bb1c05c;hb=18b8cf7807ea21217f947b5a0bd0ea8b1185b96f;hp=a8e803991a54d646f6052f877d2d126acc27c43f;hpb=0f563f23506dabd7c84bdb750d4539b2b6cacf02;p=idzebra-moved-to-github.git diff --git a/index/zebraapi.c b/index/zebraapi.c index a8e8039..5805f9f 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $Id: zebraapi.c,v 1.243 2007-01-16 15:01:15 adam Exp $ +/* $Id: zebraapi.c,v 1.247 2007-01-17 15:35:48 adam Exp $ Copyright (C) 1995-2007 Index Data ApS @@ -143,6 +143,9 @@ ZebraHandle zebra_open(ZebraService zs, Res res) zh->m_staticrank = 0; zh->m_segment_indexing = 0; + zh->break_handler_func = 0; + zh->break_handler_data = 0; + default_encoding = res_get_def(zh->session_res, "encoding", "ISO-8859-1"); zh->iconv_to_utf8 = @@ -1015,6 +1018,21 @@ ZEBRA_RES zebra_set_approx_limit(ZebraHandle zh, zint approx_limit) return ZEBRA_OK; } +void zebra_set_partial_result(ZebraHandle zh) +{ + zh->partial_result = 1; +} + + +ZEBRA_RES zebra_set_break_handler(ZebraHandle zh, + int (*f)(void *client_data), + void *client_data) +{ + zh->break_handler_func = f; + zh->break_handler_data = client_data; + return ZEBRA_OK; +} + ZEBRA_RES zebra_search_RPN_x(ZebraHandle zh, ODR o, Z_RPNQuery *query, const char *setname, zint *hits, int *estimated_hit_count, @@ -1030,12 +1048,16 @@ ZEBRA_RES zebra_search_RPN_x(ZebraHandle zh, ODR o, Z_RPNQuery *query, 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; }