Omega: Missing support for newer weighting schemes

Olly Betts olly at survex.com
Thu Apr 13 02:07:03 BST 2017


On Wed, Apr 12, 2017 at 04:21:23PM +0530, Vivek Pal wrote:
> Also, turns out that parse_params method is identical to unserialise() method
> in each Weight subclass so why not simply use unserialise method rather than
> implementing the same functionality that it provides under a different name
> like parse_params to avoid code duplication?

They're conceptually similar, but unserialise() takes a binary serialisation
of the parameters (so it can easily and compactly pass floating point values
exactly), whereas here we need to parse an ASCII string representation of
the parameters.

> In fact, the following code works just fine for all tests:
> 
>   enq.set_weighting_scheme(*wt->unserialise(p));

Currently omega has no test coverage for parsing of weighting schemes, so the
tests passing doesn't mean this works correctly.

(We only added any tests of the omega CGI about 18 months ago, and at present
we really only have tests of changes since then - feature tests for new
features and regression tests for bug fixes).

Cheers,
    Olly



More information about the Xapian-devel mailing list