[Xapian-discuss] php5 new_BM25Weight() function error

Olly Betts olly at survex.com
Wed Jun 20 12:35:02 BST 2007


On Wed, Jun 20, 2007 at 07:25:38PM +0900, Sungsoo Kim wrote:
> I am using PHP 5.1 and get the following error always.
> 
> [code]
> $enquire->set_weighting_scheme(new XapianBM25Weight(1, 0, 1, 0, 0));

It works if you write:

  $enquire->set_weighting_scheme(new XapianBM25Weight(1.0, 0.0, 1.0, 0.0, 0.0));

SWIG implements overload dispatch based on the PHP type so if a C++
method takes a double, you currently have to pass a floating point value
in PHP.

Ideally it would allow and convert an integer in cases like this where
there's no overload ambiguity, since such strict type requirements
aren't natural in PHP, but currently that doesn't happen.

Cheers,
    Olly



More information about the Xapian-discuss mailing list