Displaying 1 result from an estimated 1 matches for "wdf_double".
2010 Nov 01
1
floating-point issues with set_sort_by_relevance_then_value? (1.2.3, BM25 k1=0)
..., at least for my test cases:
I added
if (param_k1 == 0) RETURN(termweight);
to the beginning of BM25Weight::get_sumpart in
trunk/xapian-core/weight/bm25weight.cc:166
This apparently prevents floating point precision issues in the last line of
get_sumpart() [which calculates termweight * wdf_double * 1 / wdf_double]. It
also speeds up my case slightly. ;-)
In order to prevent more such issues, it might be a good idea to round weights
to a few fractional digits (10 should be enough) before using them as sort keys.
Regards,
Marinos