* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rsrel.c,v $
- * Revision 1.4 1995-09-14 07:48:56 adam
+ * Revision 1.5 1995-10-06 14:38:06 adam
+ * New result set method: r_score.
+ * Local no (sysno) and score is transferred to retrieveCtrl.
+ *
+ * Revision 1.4 1995/09/14 07:48:56 adam
* Other score calculation.
*
* Revision 1.3 1995/09/11 15:23:40 adam
static int r_count (rset_control *ct);
static int r_read (RSFD rfd, void *buf);
static int r_write (RSFD rfd, const void *buf);
+static int r_score (RSFD rfd, int *score);
static const rset_control control =
{
r_rewind,
r_count,
r_read,
- r_write
+ r_write,
+ r_score
};
const rset_control *rset_kind_relevance = &control;
if (p->position <= 0)
return 0;
--(p->position);
- logf (LOG_DEBUG, "score: %f",
- info->score_buf[info->sort_idx[p->position]]);
memcpy ((char*) buf,
info->key_buf + info->key_size * info->sort_idx[p->position],
info->key_size);
return 1;
}
+static int r_score (RSFD rfd, int *score)
+{
+ struct rset_rel_rfd *p = rfd;
+ struct rset_rel_info *info = p->info;
+
+ if (p->position < 0)
+ return 0;
+ *score = (int) (1000*info->score_buf[info->sort_idx[p->position]]);
+ return 1;
+}
+
static int r_write (RSFD rfd, const void *buf)
{
logf (LOG_FATAL, "relevance set type is read-only");