X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzsets.c;h=9cb1ca6b4f189474825be240d346212f9497774b;hb=85df66537199c30a492ad54be4fbe25fa77e18c8;hp=bf8e13932dec593a2791d29f36dcb378ad0b6f02;hpb=40ca1d08c1d83b92e0b90951d918b252c61c63b2;p=idzebra-moved-to-github.git diff --git a/index/zsets.c b/index/zsets.c index bf8e139..9cb1ca6 100644 --- a/index/zsets.c +++ b/index/zsets.c @@ -4,7 +4,16 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zsets.c,v $ - * Revision 1.7 1995-10-06 14:38:01 adam + * Revision 1.10 1995-10-30 15:08:08 adam + * Bug fixes. + * + * Revision 1.9 1995/10/17 18:02:14 adam + * New feature: databases. Implemented as prefix to words in dictionary. + * + * Revision 1.8 1995/10/10 13:59:25 adam + * Function rset_open changed its wflag parameter to general flags. + * + * Revision 1.7 1995/10/06 14:38:01 adam * New result set method: r_score. * Local no (sysno) and score is transferred to retrieveCtrl. * @@ -70,8 +79,8 @@ ZServerSet *resultSetGet (ZServerInfo *zi, const char *name) return NULL; } -ZServerSetSysno *resultSetSysnoGet (ZServerInfo *zi, const char *name, - int num, int *positions) +ZServerSetSysno *resultSetSysnoGet (ZServerInfo *zi, const char *name, + int num, int *positions) { ZServerSet *sset; ZServerSetSysno *sr; @@ -88,18 +97,18 @@ ZServerSetSysno *resultSetSysnoGet (ZServerInfo *zi, const char *name, return NULL; logf (LOG_DEBUG, "resultSetRecordGet"); sr = xmalloc (sizeof(*sr) * num); - rfd = rset_open (rset, 0); + rfd = rset_open (rset, RSETF_READ|RSETF_SORT_RANK); while (rset_read (rset, rfd, &key)) { if (key.sysno != psysno) { psysno = key.sysno; position++; + assert (num_i < num); if (position == positions[num_i]) { sr[num_i].sysno = psysno; rset_score (rset, rfd, &sr[num_i].score); - num_i++; if (++num_i == num) break; } @@ -114,11 +123,7 @@ ZServerSetSysno *resultSetSysnoGet (ZServerInfo *zi, const char *name, return sr; } -void resultSetRecordDel (ZServerInfo *zi, ZServerRecord *records, int num) +void resultSetSysnoDel (ZServerInfo *zi, ZServerSetSysno *records, int num) { - int i; - - for (i = 0; i