[Xapian-discuss] Revision: 15699: $tg->index_text ($text, $weight) fails with 'No matching function for overloaded 'TermGenerator_index_text''

Olly Betts olly at survex.com
Tue Jun 21 08:52:05 BST 2011


On Tue, Jun 21, 2011 at 09:34:34AM +0200, Henry C. wrote:
> On Tue, June 21, 2011 06:23, Olly Betts wrote:
> > I just added a couple of testcases to t/termgenerator.t which still
> > passes - these work for me:
> >
> > $termgen->index_text('foo bar baz foo', 4);
> > $termgen->index_text_without_positions('baz zoo', 42);
> >
> > What exactly are you passing for $text and $weight?
> 
> A floating point value (try 4.1 or 42.123456789 t/termgenerator.t).

Ah, I thought I'd even tried that, but I must have not rerun the test
correctly.

> If I recall correctly the core allows a double (typedef double
> Xapian::weight).

Not here - this is simply the amount which is added to the wdf for
each occurrence of a particular term.  OTOH, OP_SCALE_WEIGHT allows
a floating point scale factor because it's scaling the weight
returned by a term (which is a Xapian::weight).

So it's a slight incompatibility (presumably XS Search::Xapian accepts
this) but it doesn't actually stop you doing anything you could actually
do before.

I'll see if this can be accepted.

Cheers,
    Olly



More information about the Xapian-discuss mailing list