On Mon, Jul 01, 2013 at 12:45:05PM +0530, Aarsh Shah
wrote:> Hi olly, I rewrote the test for PL2 after adding code to deal with negative
> weights. It passes on all backends other than inmemory . I see a different
> value of weight for inmemory backend. The code to calculate the lower bound
> is implemented in init().Please can I get some help with this ?
Have you tried adding a line of code to init() to print out the stats
you are getting and see how they differ?
I suspect that the inmemory backend isn't tracking one of the stats you
are using to generated the lower bound, so returns a less tight bound
which it is able to guarantee. If you look in backends/database.cc you
can see the fall-back implementations of the methods to read these
stats. For example, get_doclength_lower_bound() always returns 1 in
this case.
If that's the issue, it's not a bug in your PL2 code, but perhaps the
new testcase should look at the difference between the weights of
documents (which should be the same)?
Cheers,
Olly