X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=rset%2Frsprox.c;h=d24d2efe5e102e67082ccd06dafecce8e052b674;hb=e172ced0dcc937dfc433a33c7e20962b9e6b5ea0;hp=fa562d8c8be55f50fa277df57f359f2f525e205f;hpb=0229bb1ac74706a4e460a11a8a8712b4ea0f2ebe;p=idzebra-moved-to-github.git diff --git a/rset/rsprox.c b/rset/rsprox.c index fa562d8..d24d2ef 100644 --- a/rset/rsprox.c +++ b/rset/rsprox.c @@ -1,4 +1,4 @@ -/* $Id: rsprox.c,v 1.18 2004-10-15 10:07:34 heikki Exp $ +/* $Id: rsprox.c,v 1.20 2004-10-22 10:12:52 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -39,11 +39,13 @@ static int r_forward(RSFD rfd, void *buf, TERMID *term, const void *untilbuf); static int r_read (RSFD rfd, void *buf, TERMID *term); static int r_write (RSFD rfd, const void *buf); static void r_pos (RSFD rfd, double *current, double *total); +static void r_get_terms(RSET ct, TERMID *terms, int maxterms, int *curterm); static const struct rset_control control = { "prox", r_delete, + r_get_terms, r_open, r_close, r_forward, @@ -196,7 +198,7 @@ static int r_forward (RSFD rfd, void *buf, TERMID *term, const void *untilbuf) (*kctrl->getseq)(p->buf[i])) { /* FIXME - We need more flexible multilevel stuff */ p->more[i-1] = rset_read ( p->rfd[i-1], p->buf[i-1], - &p->terms[i]); + &p->terms[i-1]); break; } } @@ -211,8 +213,8 @@ static int r_forward (RSFD rfd, void *buf, TERMID *term, const void *untilbuf) { memcpy (buf, p->buf[0], kctrl->key_size); if (term) - *term=p->terms[i]; - p->more[0] = rset_read (p->rfd[0], p->buf[0], &p->terms[i]); + *term=p->terms[0]; + p->more[0] = rset_read (p->rfd[0], p->buf[0], &p->terms[0]); p->hits++; return 1; } @@ -285,7 +287,7 @@ static int r_forward (RSFD rfd, void *buf, TERMID *term, const void *untilbuf) return 1; } } - p->more[1] = rset_read (p->rfd[1], p->buf[1],&p->terms[i]); + p->more[1] = rset_read (p->rfd[1], p->buf[1],&p->terms[1]); } } } @@ -337,3 +339,15 @@ static void r_pos (RSFD rfd, double *current, double *total) logf(LOG_DEBUG,"prox_pos: [%d] %0.1f/%0.1f= %0.4f ", i,*current, *total, r); } + + + +static void r_get_terms(RSET ct, TERMID *terms, int maxterms, int *curterm) +{ + struct rset_prox_info *info = + (struct rset_prox_info *) ct->priv; + int i; + for (i=0;irset_no;i++) + rset_getterms(info->rset[i], terms, maxterms, curterm); +} +