Yes, once we have gotten the code merged, we can discuss how to go about
implementing your idea. I gave a lot of thought to this problem and I could
only come up with this method at that time.


On Mon, Aug 26, 2013 at 10:55 AM, Olly Betts <notifications@github.com>wrote:

> In xapian-core/include/xapian/enquire.h:
>
> > @@ -761,6 +761,20 @@ class XAPIAN_VISIBILITY_DEFAULT Enquire {
> >  	 */
> >  	void set_weighting_scheme(const Weight &weight_);
> >
> > +	/** Set the weighting scheme to use for expansion.
> > +	 *
> > +	 *  @param eweightname_  A three character string in lowercase
> > +	 *                       specifying the name of the scheme to be used.
> > +	 *                       The following schemes are currently availabe:
> > +	 *                       "bo1" : The Bo1 scheme for query expansion.
> > +	 *                       "trad" : The TradWeight scheme for query expansion.
> > +	 *                       If no scheme is specified, TradWeight is used by default.
> > +	 *  @param expand_k_ The parameter required for TradWeight query expansion.
> > +	 *                   A default value of 1.0 is used if none is specified.
> > +	 */
> > +	void set_expansion_scheme(const std::string &eweightname_ = "trad",
> > +	                          double expand_k_ = 1.0);
>
> I think we probably want to make the *EWeight classes available in the
> public API (like Xapian::Weight) and then the user would pass one here.
> That avoids the rather awkward handling of the parameter which is only used
> by one of the schemes.
>
> This is certainly OK as a first step though.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/xapian/xapian/pull/24/files#r5971380>
> .
>