projects
/
idzebra-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1c924d8
)
More reasonable approx hits for truncated searches
author
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 22 Jan 2010 12:48:31 +0000
(13:48 +0100)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 22 Jan 2010 12:48:31 +0000
(13:48 +0100)
rset/rsmultiandor.c
patch
|
blob
|
history
diff --git
a/rset/rsmultiandor.c
b/rset/rsmultiandor.c
index
91669db
..
94534c9
100644
(file)
--- a/
rset/rsmultiandor.c
+++ b/
rset/rsmultiandor.c
@@
-613,11
+613,12
@@
static void r_pos_x(RSFD rfd, double *current, double *total, int and_op)
(struct rfd_private *)(rfd->priv);
double ratio = and_op ? 0.0 : 1.0;
int i;
(struct rfd_private *)(rfd->priv);
double ratio = and_op ? 0.0 : 1.0;
int i;
+ double sum_cur = 0.0;
+ double sum_tot = 0.0;
for (i = 0; i<ct->no_children; i++){
double nratio, cur, tot;
rset_pos(mrfd->items[i].fd, &cur, &tot);
yaz_log(log_level, "r_pos: %d %0.1f %0.1f", i, cur,tot);
for (i = 0; i<ct->no_children; i++){
double nratio, cur, tot;
rset_pos(mrfd->items[i].fd, &cur, &tot);
yaz_log(log_level, "r_pos: %d %0.1f %0.1f", i, cur,tot);
-
nratio = cur / tot;
if (and_op)
{
nratio = cur / tot;
if (and_op)
{
@@
-626,10
+627,12
@@
static void r_pos_x(RSFD rfd, double *current, double *total, int and_op)
}
else
{
}
else
{
- if (nratio < ratio)
- ratio = nratio;
+ sum_cur += cur;
+ sum_tot += tot;
}
}
}
}
+ if (!and_op)
+ ratio = sum_cur / sum_tot;
if (ratio == 0.0 || ratio == 1.0) { /* nothing there */
*current = 0;
*total = 0;
if (ratio == 0.0 || ratio == 1.0) { /* nothing there */
*current = 0;
*total = 0;