[Xapian-discuss] PHP Fatal error while indexing Wikipedia

Olly Betts olly at survex.com
Tue Jan 1 10:35:17 GMT 2008


On Tue, Jan 01, 2008 at 12:37:09AM +0000, Robert Young wrote:
> I'm indexing a Wikipedia dump as a way of getting to grips with how
> Xapian works but I'm hitting a problem. Indexing fails with the error
> pasted below. Although I haven't managed to nail down exactly which
> Wikipedia article is causing the error, I am pretty sure it is the
> same one each time. I will try to find out exactly which one it is
> causing the problem but I was wondering if anyone has come across this
> problem before. The only thing I can think it may be is a dodgy
> character, is this something which might make Xapian stumble?

No, Xapian should handle arbitrary data.  The UTF-8 parsing copes with
broken UTF-8 too.

> PHP Fatal error:  No matching function for overloaded
> 'TermGenerator_index_text' in /usr/local/lib/php/xapian.php on line
> 1482

Which xapian-bindings version is this?  Line 1482 doesn't seem to match
up with my tree.

It sounds like either you're passing in parameters with the wrong type,
or it's a bug in the wrappers SWIG is generating, but it's hard to know
which without seeing your indexer code.  The generated code looks OK to
me at least.

My best guess is that maybe you are passing a string for the weight
parameter in some case - as the documentation says:

http://www.xapian.org/docs/bindings/php/

    One thing to be aware of though is that SWIG implements dispatch
    functions for overloaded methods based on the types of the
    parameters, so you can't always pass in a string containing a number
    (e.g. "42") where a number is expected as you usually can in PHP.
    You need to explicitly convert to the type required - e.g. use (int)
    to convert to an integer, (string) to string, (double) to a floating
    point number.

Cheers,
    Olly



More information about the Xapian-discuss mailing list