projects
/
idzebra-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implemented zebra.cfg directive 'passwd.c' which specifies user accounts
[idzebra-moved-to-github.git]
/
index
/
zvrank.c
diff --git
a/index/zvrank.c
b/index/zvrank.c
index
ae03f92
..
ed9cefd
100644
(file)
--- a/
index/zvrank.c
+++ b/
index/zvrank.c
@@
-1,6
+1,6
@@
-/* $Id: zvrank.c,v 1.13 2004-11-04 13:09:06 heikki Exp $
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
- Index Data Aps
+/* $Id: zvrank.c,v 1.17 2005-05-24 11:27:19 adam Exp $
+ Copyright (C) 1995-2005
+ Index Data ApS
This file is part of the Zebra server.
This file is part of the Zebra server.
@@
-53,8
+53,8
@@
fernuni-hagen.de>
#include "index.h"
#include "index.h"
-static int log_level=0;
-static int log_initialized=0;
+static int log_level = 0;
+static int log_initialized = 0;
static double blog(double x) {
/* log_2, log_e or log_10 is used, best to change it here if necessary */
static double blog(double x) {
/* log_2, log_e or log_10 is used, best to change it here if necessary */
@@
-342,7
+342,7
@@
static void idf_squared(void *rsi, void *dsi) {
if (gocc==0)
idf=0.0;
else
if (gocc==0)
idf=0.0;
else
- idf=blog(num_docs/gocc);
+ idf=blog(CAST_ZINT_TO_DOUBLE(num_docs/gocc));
idf=idf*idf;
ds->terms[i].idf=idf;
}
idf=idf*idf;
ds->terms[i].idf=idf;
}
@@
-669,13
+669,13
@@
static void *zv_create (ZebraHandle zh) {
xmalloc (sizeof(*ci));
if (!log_initialized)
{
xmalloc (sizeof(*ci));
if (!log_initialized)
{
- log_level=yaz_log_module_level("zvrank");
- log_initialized=1;
+ log_level = yaz_log_module_level("zvrank");
+ log_initialized = 1;
}
yaz_log(log_level, "zv_create");
}
yaz_log(log_level, "zv_create");
- wscheme=res_get_def(res, "zvrank.weighting-scheme", "");
- for (i=0; wscheme[i] && i < 8; i++)
+ wscheme= res_get_def(res, "zvrank.weighting-scheme", "");
+ for (i = 0; wscheme[i] && i < 8; i++)
ci->rscheme[i]=wscheme[i];
ci->rscheme[i] = '\0';
return ci;
ci->rscheme[i]=wscheme[i];
ci->rscheme[i] = '\0';
return ci;
@@
-764,13
+764,13
@@
static void zv_end (struct zebra_register *reg, void *rsi)
*/
static void zv_add (void *rsi, int seqno, TERMID term) {
RS rs=(RS)rsi;
*/
static void zv_add (void *rsi, int seqno, TERMID term) {
RS rs=(RS)rsi;
+ int *ip = term->rankpriv;
+ int i=*ip;
if (!term)
{
yaz_log(log_level, "zvrank zv_add seqno=%d NULL term",seqno );
return;
}
if (!term)
{
yaz_log(log_level, "zvrank zv_add seqno=%d NULL term",seqno );
return;
}
- int *ip = term->rankpriv;
- int i=*ip;
rs->rdoc->terms[i].locc++;
yaz_log(log_level, "zvrank zv_add seqno=%d '%s' term_index=%d cnt=%d",
seqno, term->name, i, rs->rdoc->terms[i].locc );
rs->rdoc->terms[i].locc++;
yaz_log(log_level, "zvrank zv_add seqno=%d '%s' term_index=%d cnt=%d",
seqno, term->name, i, rs->rdoc->terms[i].locc );