[Xapian-discuss] replace_document and delete_document with string UID not working in PHP bindings?

Pascal Opitz contact at pascalopitz.com
Tue Nov 3 11:04:18 GMT 2009


Sorry, tried to ask this question before, not sure why it went in as  
reply to another thread:

http://lists.xapian.org/pipermail/xapian-discuss/2009-October/007249.html

Apologies for the confusion. Not really used to mailing lists.
So here it is again:



I am currently trying to index documents using the replace_document
method, and am passing a string instead of a docid:

$this->xapian_write_db->replace_document((string)
self::XAPIAN_PREFIX_UNIQUE . $row['item_guid'], $doc);

In this example, the term will end up as 'Q' plus a guid like
'1744e18c4d37c8294d5a682e885c13dc'.

If I run this again, the document gets added again, and not replaced,
and I end up with multiple matches on the same search term.
Also, when I use delete_document with a string as UID, there seems to
be no match and my document will still be in place.

Is this a known quirk/bug, and is there a workaround for this, or will
I have to run a query for the string UID and extract the docid for
each match?



I might add that this is using the latest ubuntu packages.
For now I am using a numeric foreign ID, and that works fine, but it  
means that I will have to alter a very large table in a live  
environment, which I'd like to avoid.


Best


Pascal Opitz



More information about the Xapian-discuss mailing list