-/* $Id: dir.c,v 1.27 2002-10-30 12:58:21 adam Exp $
+/* $Id: dir.c,v 1.28 2003-01-13 22:37:12 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
pathpos = strlen(path);
if (!pathpos || path[pathpos-1] != '/')
path[pathpos++] = '/';
- while (
-#if _REENTRANT
- (readdir_r (dir, &dent_s, &dent) == 0 && dent)
-#else
- (dent = readdir (dir))
-#endif
- )
+ while ( (dent = readdir (dir)) )
{
struct stat finfo;
if (strcmp (dent->d_name, ".") == 0 ||
-/* $Id: rank1.c,v 1.10 2002-08-02 19:26:55 adam Exp $
+/* $Id: rank1.c,v 1.11 2003-01-13 22:37:12 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
struct rank_set_info *si = (struct rank_set_info *) xmalloc (sizeof(*si));
int i;
- logf (LOG_DEBUG, "rank-1 begin");
+ logf (LOG_LOG, "rank-1 begin");
si->no_entries = rset->no_rset_terms;
si->no_rank_entries = 0;
si->entries = (struct rank_term_info *)
for (i = 0; i < si->no_entries; i++)
{
int g = rset->rset_terms[i]->nn;
+ yaz_log(LOG_LOG, "i=%d flags=%s", i, rset->rset_terms[i]->flags);
if (!strncmp (rset->rset_terms[i]->flags, "rank,", 5))
{
- yaz_log (LOG_LOG, "%s", rset->rset_terms[i]->flags);
si->entries[i].rank_flag = 1;
si->entries[i].rank_weight = atoi (rset->rset_terms[i]->flags+5);
- yaz_log (LOG_LOG, "i=%d weight=%d", i, si->entries[i].rank_weight);
+ yaz_log (LOG_LOG, " weight=%d", i, si->entries[i].rank_weight);
(si->no_rank_entries)++;
}
else
static void add (void *set_handle, int seqno, int term_index)
{
struct rank_set_info *si = (struct rank_set_info *) set_handle;
- /*logf (LOG_DEBUG, "rank-1 add seqno=%d term_index=%d", seqno, term_index);*/
+ yaz_log (LOG_LOG, "rank-1 add seqno=%d term_index=%d", seqno, term_index);
si->last_pos = seqno;
si->entries[term_index].local_occur++;
}
if (!si->no_rank_entries)
return -1;
+ yaz_log(LOG_LOG, "calc");
for (i = 0; i < si->no_entries; i++)
+ {
+ yaz_log(LOG_LOG, "i=%d rank_flag=%d lo=%d",
+ i, si->entries[i].rank_flag, si->entries[i].local_occur);
if (si->entries[i].rank_flag && (lo = si->entries[i].local_occur))
score += (8+log2_int (lo)) * si->entries[i].global_inv *
si->entries[i].rank_weight;
+ }
divisor = si->no_rank_entries * (8+log2_int (si->last_pos/si->no_entries));
score = score / divisor;
yaz_log (LOG_LOG, "sysno=%d score=%d", sysno, score);
-/* $Id: zsets.c,v 1.39 2002-08-28 19:52:29 adam Exp $
+/* $Id: zsets.c,v 1.40 2003-01-13 22:37:12 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
do
{
kno++;
+ yaz_log(LOG_LOG, "sysno=%d seqno=%d idx=%d", key.sysno, key.seqno,
+ term_index);
if (key.sysno != psysno)
{
score = (*rc->calc) (handle, psysno);