Commit 1dd6bd19 authored by Teodor Sigaev's avatar Teodor Sigaev

Add sanity check of query

parent 90456d13
...@@ -303,7 +303,8 @@ calc_rank_or(float *w, tsvector * t, QUERYTYPE * q) ...@@ -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 + ( wjm + resj - wjm/((jm+1)*(jm+1)))/1.64493406685;
} }
res = res /size; if ( size > 0 )
res = res /size;
pfree(item); pfree(item);
return res; return res;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment