Omega: Missing support for newer weighting schemes

Vivek Pal vivekpal.dtu at gmail.com
Fri Apr 21 11:38:06 BST 2017


> Thanks Olly for clarifying. So, we want to define a static parse_params
> method needs to defined be in Xapian::Weight that would take "scheme" and
> a Registry object to do the following set of things:
>
> 1. get an appropriate weighting scheme object by looking at the first
> word in "scheme" string,
>
> 2. call parse_params method defined in that particular weighting scheme
> subclass with just parameter string (e.g. parse_params("1.0 0.5")) which
> creates and returns the weighting scheme object.
>
> 3. then ultimately return the weighting scheme object to the code in
omega:
>
>     enq.set_weighting_scheme(Xapian::Weight::parse_params(scheme));
>
> This is my current understanding of the main idea here but if you see
> something odd then please let me know.
>
> > Yes, that's the idea.

Okay, great! -- that's a cue for me to start implementing the idea.

> We probably don't want to use the same name for the virtual method which
> takes just the parameter part, especially as both would be callable with
> a single string (I did use "parse_params" to refer to both, but that was
> mostly because I got mixed up as to which I was talking about).

That had me confused at one point in the previous conversations :) but
now the idea seems clear to me.

> Perhaps "create_from_parameters" for that one?  It's conceivably useful
> to call from user code (if you want to fix the weighting scheme and just
> allow the parameters to be specified) but the longer name is a bit of a
> signal that it's less commonly used.

"create_from_parameters" sounds good to me and it makes quite sense
given the thoughts behind it.

P.S. it has been another busy week on campus here, so didn't quite
have a chance to further dive into it. Although, the weekend is here
so I'll make some progress on this front in the next few days.

Thanks,
Vivek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20170421/48340654/attachment.html>


More information about the Xapian-devel mailing list