That's the problem. ExpandWeights needs to be mutable as we have yet to
call collect_stats() on it. I can not add the functionality of
collect_stats() to the constructor as the object will be constructed only
once but we will have to collect new statistics for each term.

-Regards
-Aarsh


On Tue, Aug 20, 2013 at 10:05 AM, Dan Colish <notifications@github.com>wrote:

> In xapian-core/expand/esetinternal.cc:
>
> > @@ -139,7 +139,7 @@ struct CompareTermListSizeAscending {
> >  		       const Xapian::Database & db,
> >  		       const RSet & rset,
> >  		       const Xapian::ExpandDecider * edecider,
> > -		       const Xapian::Internal::ExpandWeight & eweight,
> > +		       Xapian::Internal::ExpandWeight & eweight,
>
> Ok I think the ExpandWeight can be injected via a factory. This factory
> can push down the whole collect and clear stats so we dont have to worry
> about it here. In addition, we could make it a const instead. I'm still a
> little concerned about the mutable state that ExpandWeight now has.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/xapian/xapian/pull/24/files#r5860423>
> .
>