Displaying 3 results from an estimated 3 matches for "get_weighting_schem".
Did you mean:
get_weighting_scheme
2017 Apr 09
3
Omega: Missing support for newer weighting schemes
On Sun, Apr 09, 2017 at 11:34:07PM +0530, Vivek Pal wrote:
> > Each scheme already has a human-readable name, and Xapian::Registry
> > can map that to an "examplar" object of the right type, so we
> > could take a string like "bm25 1 0.8", see the first word is "bm25"
> > and get a BM25Weight object, then call parse_params("1 0.8") on
2017 Apr 13
2
Omega: Missing support for newer weighting schemes
...ote:
> > No, use Xapian::Registry to find the weighting scheme from the name
> > like how Weight::unserialise() does (otherwise every caller would need
> > code similar to that above).
>
> Okay, I looked into Xapian::Registry and it seems you are referring to using
> the get_weighting_scheme method? (which expects a string e.g. "bm25" i.e. the
> name of a weighting scheme.)
Yes, you pass it a string and it gives you the registered object with that
name.
> And, Weight::unserialise() looks like throwing a Xapian::UnimplementedError
> error. I wonder if you meant the...
2017 Apr 12
4
Omega: Missing support for newer weighting schemes
...think.
if (startswith(scheme, "pl2")) {
const char *p = scheme.c_str() + 3;
if (*p == '\0') {
enq.set_weighting_scheme(Xapian::BM25Weight());
return;
}
if (C_isspace(*p)) {
Xapian::Registry reg;
const Xapian::Weight * wt =
reg.get_weighting_scheme("Xapian::PL2Weight");
enq.set_weighting_scheme(*wt->set_parameter_values(p));
return;
}
}
Although, I'm still having a hard time trying to figure out how it's possible
to achieve what we do with the above code by just:
enq.set_weighting_scheme(Xapian::...