[Xapian-discuss] replace_document issue

Olly Betts olly at survex.com
Tue Apr 30 13:33:30 BST 2013


On Tue, Apr 30, 2013 at 07:15:19AM -0500, Michael Lewis wrote:
>       $docid=$database->replace_document($rid,$doc);
[...]
> I was under the impression that using the replace_document() function
> allowed me to set the document ID. Am I wrong or what am I doing
> wrong?

In C++, there are two versions of replace_document() - one takes a
docid, while the other takes a term (so you can easily replace a
document by a unique key).  From PHP which you get depends if you pass a
string or integer, so you probably want to use:

       $docid=$database->replace_document(intval($rid),$doc);

Cheers,
    Olly



More information about the Xapian-discuss mailing list