40 static void r_pos(
RSFD rfd,
double *current,
double *total);
75 int ordered,
int exclusion,
76 int relation,
int distance)
102 yaz_log(YLOG_FATAL,
"prox set type is read-only");
122 yaz_log(YLOG_DEBUG,
"rsprox (%s) open [%p] n=%d",
159 &p->
terms[0], untilbuf);
187 else if (info->
relation == 2 && diff <= info->distance)
189 else if (info->
relation == 1 && diff < info->distance)
231 seqno[n++] = (*kctrl->
getseq)(p->
buf[0]);
239 seqno[n++] = (*kctrl->
getseq)(p->
buf[0]);
247 for (i = 0; i < n; i++)
251 if (!info->
ordered && diff < 0)
256 if (diff < info->distance && diff >= 0)
260 if (diff <= info->distance && diff >= 0)
264 if (diff == info->
distance && diff >= 0)
268 if (diff >= info->
distance && diff >= 0)
272 if (diff > info->
distance && diff >= 0)
276 if (diff != info->
distance && diff >= 0)
307 static void r_pos(
RSFD rfd,
double *current,
double *total)
320 double nratio = cur / tot;
325 *current = (double) p->
hits;
327 *total = *current/ratio;
331 yaz_log(YLOG_DEBUG,
"prox_pos: [%d] %0.1f/%0.1f= %0.4f ",
332 i, *current, *total, ratio);
RSET rset_create_base(const struct rset_control *sel, NMEM nmem, struct rset_key_control *kcontrol, int scope, TERMID term, int no_children, RSET *children)
Common constuctor for RSETs.
#define rset_read(rfd, buf, term)
int rset_no_write(RSFD rfd, const void *buf)
RSFD rfd_create_base(RSET rs)
Common constuctor for RFDs.
#define rset_getterms(ct, terms, maxterms, curterm)
#define rset_pos(rfd, cur, tot)
#define rset_open(rs, wflag)
void rset_close(RSFD rfd)
Closes a result set RFD handle.
#define rset_forward(rfd, buf, term, untilbuf)
static const struct rset_control control
static int r_read(RSFD rfd, void *buf, TERMID *term)
static void r_get_terms(RSET ct, TERMID *terms, int maxterms, int *curterm)
static void r_delete(RSET ct)
static int r_forward(RSFD rfd, void *buf, TERMID *term, const void *untilbuf)
static void r_pos(RSFD rfd, double *current, double *total)
RSET rset_create_prox(NMEM nmem, struct rset_key_control *kcontrol, int scope, int rset_no, RSET *rset, int ordered, int exclusion, int relation, int distance)
static RSFD r_open(RSET ct, int flag)
static void r_close(RSFD rfd)
int(* cmp)(const void *p1, const void *p2)
zint(* getseq)(const void *p)
const struct rset_control * control
struct rset_key_control * keycontrol