projects
/
users
/
rhaas
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
90456d1
)
Add sanity check of query
author
Teodor Sigaev
<teodor@sigaev.ru>
Mon, 31 Oct 2005 13:47:09 +0000
(13:47 +0000)
committer
Teodor Sigaev
<teodor@sigaev.ru>
Mon, 31 Oct 2005 13:47:09 +0000
(13:47 +0000)
contrib/tsearch2/rank.c
patch
|
blob
|
blame
|
history
diff --git
a/contrib/tsearch2/rank.c
b/contrib/tsearch2/rank.c
index 40bec1f48407be28356ef0c60313e144f755ed39..445898eff69a74a58bbfb7b5a3b45d6cf48b06bf 100644
(file)
--- a/
contrib/tsearch2/rank.c
+++ b/
contrib/tsearch2/rank.c
@@
-303,7
+303,8
@@
calc_rank_or(float *w, tsvector * t, QUERYTYPE * q)
*/
res = res + ( wjm + resj - wjm/((jm+1)*(jm+1)))/1.64493406685;
}
- res = res /size;
+ if ( size > 0 )
+ res = res /size;
pfree(item);
return res;
}