81 log_level = yaz_log_module_level(
"rank1");
108 void *class_handle,
RSET rset, NMEM nmem,
109 TERMID *terms,
int numterms)
120 nmem_malloc(si->
nmem,
sizeof(*si->
entries)*numterms);
121 for (i = 0; i < numterms; i++)
124 yaz_log(
log_level,
"i=%d flags=%s '%s'", i,
125 terms[i]->flags, terms[i]->name );
126 if (!strncmp(terms[i]->flags,
"rank,", 5))
128 const char *cp = strstr(terms[i]->flags+4,
",w=");
175 yaz_log(
log_level,
"rank-1 add NULL term");
182 yaz_log(
log_level,
"rank-1 add seqno=%d term=%s count=%d",
195 int i, lo, divisor, score = 0;
203 yaz_log(
log_level,
"calc: i=%d rank_flag=%d lo=%d",
210 score = score / divisor;
223 int score =
calc_1(set_handle, sysno, staticrank, stop_flag);
224 return score - staticrank;
static int calc_2(void *set_handle, zint sysno, zint staticrank, int *stop_flag)
static void * begin(struct zebra_register *reg, void *class_handle, RSET rset, NMEM nmem, TERMID *terms, int numterms)
static void end(struct zebra_register *reg, void *set_handle)
static int calc_1(void *set_handle, zint sysno, zint staticrank, int *stop_flag)
static void * create(ZebraHandle zh)
static struct rank_control rank_1_control
static int log_initialized
static void destroy(struct zebra_register *reg, void *class_handle)
struct rank_control * rank_2_class
static int log2_int(zint g)
static struct rank_control rank_2_control
static void add(void *set_handle, int seqno, TERMID term)
struct rank_control * rank_1_class
zint rset_count(RSET rs)
Estimates hit count for result set.
struct rank_term_info * entries