X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzsets.c;h=949ace4a54320608ceb3b4309911eabd408b53b7;hb=593927cb1897c1e3163c284448eff7fee6ddad51;hp=ed60386944b4fe31a85b342f06f3b3da3bc0b4e1;hpb=342c28e71fe5122d17d760a930107cab0266e9c6;p=idzebra-moved-to-github.git diff --git a/index/zsets.c b/index/zsets.c index ed60386..949ace4 100644 --- a/index/zsets.c +++ b/index/zsets.c @@ -1,4 +1,4 @@ -/* $Id: zsets.c,v 1.93 2005-08-19 09:21:34 adam Exp $ +/* $Id: zsets.c,v 1.96 2005-10-28 07:25:30 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -872,6 +872,7 @@ ZEBRA_RES resultSetRank(ZebraHandle zh, ZebraSet zebraSet, terms, numTerms); zint psysno = 0; /* previous doc id / sys no */ zint pstaticrank = 0; /* previous static rank */ + int stop_flag = 0; while (rset_read(rfd, &key, &termid)) { zint this_sys = key.mem[sysno_mem_index]; @@ -886,10 +887,13 @@ ZEBRA_RES resultSetRank(ZebraHandle zh, ZebraSet zebraSet, break; if (psysno) { /* only if we did have a previous record */ - score = (*rc->calc) (handle, psysno, pstaticrank); + score = (*rc->calc) (handle, psysno, pstaticrank, + &stop_flag); /* insert the hit. A=Ascending */ resultSetInsertRank (zh, sort_info, psysno, score, 'A'); count++; + if (stop_flag) + break; } psysno = this_sys; if (zh->m_staticrank) @@ -900,7 +904,7 @@ ZEBRA_RES resultSetRank(ZebraHandle zh, ZebraSet zebraSet, /* no more items */ if (psysno) { /* we had - at least - one record */ - score = (*rc->calc)(handle, psysno, pstaticrank); + score = (*rc->calc)(handle, psysno, pstaticrank, &stop_flag); /* insert the hit. A=Ascending */ resultSetInsertRank(zh, sort_info, psysno, score, 'A'); count++; @@ -1068,7 +1072,7 @@ ZEBRA_RES zebra_snippets_hit_vector(ZebraHandle zh, const char *setname, zint sysno, zebra_snippets *snippets) { ZebraSet sset = resultSetGet(zh, setname); - yaz_log(YLOG_LOG, "zebra_get_hit_vector setname=%s zysno=" ZINT_FORMAT, + yaz_log(YLOG_DEBUG, "zebra_get_hit_vector setname=%s zysno=" ZINT_FORMAT, setname, sysno); if (!sset) return ZEBRA_FAIL; @@ -1107,7 +1111,6 @@ ZEBRA_RES zebra_snippets_hit_vector(ZebraHandle zh, const char *setname, for (ol = termid->ol; ol; ol = ol->next) { zebra_snippets_append(snippets, key.mem[key.len-1], - termid->reg_type, ol->ord, termid->name); } } @@ -1116,6 +1119,7 @@ ZEBRA_RES zebra_snippets_hit_vector(ZebraHandle zh, const char *setname, rset_delete(rset_comb); nmem_destroy(nmem); + kc->dec(kc); } return ZEBRA_OK; }