-/* $Id: zsets.c,v 1.61 2004-09-13 09:02:16 adam Exp $
+/* $Id: zsets.c,v 1.64 2004-10-20 14:32:28 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
return NULL;
if (s->rset)
rset_delete (s->rset);
+ if (s->rset_nmem)
+ nmem_destroy (s->rset_nmem);
if (s->nmem)
nmem_destroy (s->nmem);
}
{
NMEM nmem = nmem_create ();
yaz_log (LOG_LOG, "research %s", name);
+ if (!s->rset_nmem)
+ s->rset_nmem=nmem_create();
s->rset =
rpn_search (zh, nmem, s->rset_nmem, s->rpn, s->num_bases,
s->basenames, s->name, s);
while (num_i < num && positions[num_i] < position)
num_i++;
rfd = rset_open (rset, RSETF_READ);
- while (num_i < num && rset_read (rfd, &key))
+ while (num_i < num && rset_read (rfd, &key, 0))
{
-#if IT_KEY_NEW
zint this_sys = key.mem[0];
-#else
- zint this_sys = key.sysno;
-#endif
if (this_sys != psysno)
{
psysno = this_sys;
}
}
rfd = rset_open (rset, RSETF_READ);
- while (rset_read (rfd, &key))
+ while (rset_read (rfd, &key,0))
+ /* FIXME - pass a TERMID *, and use it for something below !! */
{
-#if IT_KEY_NEW
zint this_sys = key.mem[0];
-#else
- zint this_sys = key.sysno;
-#endif
if (this_sys != psysno)
{
(sset->hits)++;
}
rc = rank_class->control;
- if (rset_read (rfd, &key))
+ if (rset_read (rfd, &key, 0))
+ /* FIXME - Pass a TERMID *, and use it for something ?? */
{
-#if IT_KEY_NEW
zint psysno = key.mem[0];
-#else
- zint psysno = key.sysno;
-#endif
int score;
void *handle =
(*rc->begin) (zh->reg, rank_class->class_handle, rset);
est=-1; /* can not do */
do
{
-#if IT_KEY_NEW
zint this_sys = key.mem[0];
-#else
- zint this_sys = key.sysno;
-#endif
kno++;
if (this_sys != psysno)
{
/* term lists! */
/* (*rc->add) (handle, this_sys, term_index); */
- if ( (est==-2) && (zebraSet->hits==esthits))
- { /* time to estimate the hits */
- rset_pos(rfd,&cur,&tot);
- if (tot>0) {
- ratio=cur/tot;
- est=(zint)(0.5+zebraSet->hits/ratio);
- logf(LOG_LOG, "Estimating hits (%s) "
- "%0.1f->"ZINT_FORMAT
- "; %0.1f->"ZINT_FORMAT,
- rset->control->desc,
- cur, zebraSet->hits,
- tot,est);
- i=0; /* round to 3 significant digits */
- while (est>1000) {
- est/=10;
- i++;
+ if ( (est==-2) && (zebraSet->hits==esthits))
+ { /* time to estimate the hits */
+ rset_pos(rfd,&cur,&tot);
+ if (tot>0) {
+ ratio=cur/tot;
+ est=(zint)(0.5+zebraSet->hits/ratio);
+ logf(LOG_LOG, "Estimating hits (%s) "
+ "%0.1f->"ZINT_FORMAT
+ "; %0.1f->"ZINT_FORMAT,
+ rset->control->desc,
+ cur, zebraSet->hits,
+ tot,est);
+ i=0; /* round to 3 significant digits */
+ while (est>1000) {
+ est/=10;
+ i++;
+ }
+ while (i--) est*=10;
+ zebraSet->hits=est;
}
- while (i--) est*=10;
- zebraSet->hits=est;
}
}
- }
- while (rset_read (rfd, &key) && (est<0) );
-
+ while (rset_read (rfd, &key,0) && (est<0) );
+ /* FIXME - term ?? */
score = (*rc->calc) (handle, psysno);
resultSetInsertRank (zh, sort_info, psysno, score, 'A');
(*rc->end) (zh->reg, handle);