Yes, thanks for this one. I'll throw an argument error here and update the
code and tests for all the weighting schemes accordingly.




On Fri, Jun 21, 2013 at 8:07 PM, Dan Colish <notifications@github.com>wrote:

> In xapian-core/include/xapian/weight.h:
>
> > +    /// The wdf normalization parameter in the formula.
> > +    double param_c;
> > +
> > +    InL2Weight * clone() const;
> > +
> > +    void init(double factor);
> > +
> > +  public:
> > +    /** Construct a InL2Weight.
> > +     *
> > +     *  @param c  A non-negative and non zero parameter controlling the extent of the normalization
> > +     *		  of the wdf to the document length.A default value of 1 is suitable for longer queries but it may need to be changed for shorter
> > +     *		  queries.For more information,please refer to Gianni Amati's PHD thesis.
> > +     */
> > +    explicit InL2Weight(double c_ = 1.0) : param_c(c_) {
> > +       if (param_c <= 0) param_c = 1;
>
> I think we should error here rather than silently normalizing the invalid
> input.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/xapian/xapian/pull/11/files#r4819087>
> .
>