- int i, veclen;
- int score=0;
- double dscore=0.0;
- RS rs=(RS)rsi;
- /* yaz_log(LOG_DEBUG, "zv_calc\n"); */
- /**/
- veclen=rs->veclen;
- if (veclen==0)
- return -1;
- for (i = 0; i < veclen; i++) {
- (*rs->q_tf_fct)(rs, rs->qdoc); /* we should actually do this once */
- (*rs->q_idf_fct)(rs, rs->qdoc);
- (*rs->q_norm_fct)(rs, rs->qdoc);
-
- (*rs->d_tf_fct)(rs, rs->rdoc);
- (*rs->d_idf_fct)(rs, rs->rdoc);
- (*rs->d_norm_fct)(rs, rs->rdoc);
-
- dscore=rs->sim_fct(rs->qdoc, rs->rdoc);
- }
- score = dscore * 1000;
- yaz_log (LOG_LOG, "sysno=%d score=%d", sysno, score);
- if (score > 1000)
- score = 1000;
- /*
- for (i = 0; i < si->no_entries; i++)
- si->entries[i].local_occur = 0;
- */
- return score;
+ int i, veclen;
+ int score=0;
+ double dscore=0.0;
+ RS rs=(RS)rsi;
+ /* yaz_log(LOG_DEBUG, "zv_calc"); */
+ /**/
+ veclen=rs->veclen;
+ if (veclen==0)
+ return -1;
+ for (i = 0; i < veclen; i++) {
+ /* qdoc weight has already been calculated */
+ (*rs->d_tf_fct)(rs, rs->rdoc);
+ (*rs->d_idf_fct)(rs, rs->rdoc);
+ (*rs->d_norm_fct)(rs, rs->rdoc);
+ dscore=rs->sim_fct(rs->qdoc, rs->rdoc);
+ }
+ score = dscore * 1000;
+ yaz_log (LOG_LOG, "sysno=%d score=%d", sysno, score);
+ if (score > 1000) /* should not happen */
+ score = 1000;
+ return score;