[Xapian-discuss] Re: Easy deletion of documents?

Olly Betts olly at survex.com
Wed Jan 4 05:17:34 GMT 2006


On Wed, Jan 04, 2006 at 05:04:47AM +0000, Ted Jordan wrote:
> WritableDatabase_delete_document($database, 'extid:1367');
> 
> but I get the following error:
> 
> Fatal error: InvalidArgumentError: Document ID 0 is invalid

SWIG didn't support function overloading for PHP until very recently, so
in 0.9.2, you have to use WritableDatabase_delete_document_by_term to
say that the 2nd argument is a term not a docid.  The next release will
be generated with a newer version of SWIG where such renaming is no
longer required.

So the error you have is because the bindings try to parse 'extid:1367'
as a number and fail so get 0, then try to delete docid 0, which Xapian
throws an error for.

Cheers,
    Olly



More information about the Xapian-discuss mailing list