[Xapian-discuss] QueryParser API Docs

Olly Betts olly at survex.com
Wed Mar 30 22:49:13 BST 2005


On Wed, Mar 30, 2005 at 12:01:43PM -0500, Mike Boone wrote:
> I've been getting lots of "PHP Warning: Wrong parameter count for..." type
> errors in upgrading to 0.8.5.1.

I've had a look at the SWIG generated file php4/xapian_wrap.cc from
0.8.5.1.  Oddly, it's not generated with swig 1.3.22 (as it should
have been).  And the code to handle optional parameters isn't there.

So the conclusion is that SWIG > 1.3.22 *IS* a problem for PHP4 (sigh,
I'd just concluded the opposite this week and backed out that change).
And that somehow I built 0.8.5.1 with the wrong version.  Ah, probably
because the CVS snapshot builder didn't regenerate the file...

The replacement php4/xapian_wrap.cc which I uploaded for 0.8.5 is
generated with SWIG 1.3.22 so that should work:

http://www.oligarchy.co.uk/xapian/0.8.5/xapian_wrap.cc.gz

> It looks like in the case of set_stemming_options, I have to add the 'false'
> to set the stem_all parameter (what does that do?).

If true, everything is stemmed.  By default, words ending with a "." are
treated as already stemmed (mostly so topterms can add already stemmed
forms) and capitalised words are handled specially.

> Does SWIG allow for default parameter values?

It should, but the SWIG folk recently reworked how this is handled and
that broke the PHP backend.  Unfortunately the SWIG PHP maintainer
(that's Sam) is overloaded and hasn't had any time to work on it for
ages.  Things are unfortunately starting to bitrot as changes to generic
SWIG code break PHP.

Another annoyance is that we can't generate a proper object interface in
PHP because the generated code just segfaults.  Sam is pretty sure that
this used to work.

If anyone is motivated and has the time, I suspect it wouldn't be too
hard to get both of these things working again.  But much as I'd like to
get this fixed, I already have more than enough to do!

Cheers,
    Olly



More information about the Xapian-discuss mailing list